Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
buffer(width) {
const parser = new OL3Parser();
parser.inject(
Point,
LineString,
LinearRing,
Polygon,
MultiPoint,
MultiLineString,
MultiPolygon,
);
const features = this.selectInteraction.getFeatures().getArray();
for (let i = 0; i < features.length; i += 1) {
const jstsGeom = parser.read(features[i].getGeometry());
const bo = new BufferOp(jstsGeom);
const buffered = bo.getResultGeometry(width);
features[i].setGeometry(parser.write(buffered));
}
}