Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
applyTopologyOperation(features) {
super.applyTopologyOperation(features);
if (features.length < 2) {
return;
}
const parser = new OL3Parser();
parser.inject(
Point,
LineString,
LinearRing,
Polygon,
MultiPoint,
MultiLineString,
MultiPolygon,
);
for (let i = 1; i < features.length; i += 1) {
const geom = parser.read(features[0].getGeometry());
const otherGeom = parser.read(features[i].getGeometry());
const diffGeom = OverlayOp.difference(geom, otherGeom);
features[0].setGeometry(parser.write(diffGeom));
features[i].setGeometry(null);
applyTopologyOperation(features) {
super.applyTopologyOperation(features);
const parser = new OL3Parser();
parser.inject(
Point,
LineString,
LinearRing,
Polygon,
MultiPoint,
MultiLineString,
MultiPolygon,
);
for (let i = 1; i < features.length; i += 1) {
const geom = parser.read(features[0].getGeometry());
const otherGeom = parser.read(features[i].getGeometry());
const unionGeom = OverlayOp.union(geom, otherGeom);
features[0].setGeometry(parser.write(unionGeom));
features[i].setGeometry(null);
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));
applyTopologyOperation(features) {
super.applyTopologyOperation(features);
if (features.length < 2) {
return;
}
const parser = new OL3Parser();
parser.inject(
Point,
LineString,
LinearRing,
Polygon,
MultiPoint,
MultiLineString,
MultiPolygon,
);
for (let i = 1; i < features.length; i += 1) {
const geom = parser.read(features[0].getGeometry());
const otherGeom = parser.read(features[i].getGeometry());
const intersectGeom = OverlayOp.intersection(geom, otherGeom);
features[0].setGeometry(parser.write(intersectGeom));
features[i].setGeometry(null);