How to use the jsts/org/locationtech/jts/geom/Geometry.prototype function in jsts

To help you get started, we’ve selected a few jsts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skeate / Leaflet.buffer / src / jsts-monkey.js View on Github external
/*
 * This file is here to attempt to prune down the huge size incurred by simply
 * importing the entirety of JSTS. We only need the BufferOp, so this copies the
 * essence of jsts/src/org/locationtech/jts/monkey.js, but reduces it to only
 * provide the `buffer` method.
 */

import BufferOp from 'jsts/org/locationtech/jts/operation/buffer/BufferOp';
import Geometry from 'jsts/org/locationtech/jts/geom/Geometry';
import extend from 'jsts/extend';

extend(Geometry.prototype, {
  buffer(distance) {
    return BufferOp.bufferOp(this, distance);
  },
});