Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => {
if(this.isActive){
const selectionFeature = mainLizmap.digitizing.featureDrawn;
if (selectionFeature){
// Handle buffer if any
this._bufferLayer.destroyFeatures();
if (this._bufferValue > 0) {
const geoJSONParser = new OpenLayers.Format.GeoJSON();
const drawGeoJSON = geoJSONParser.write(selectionFeature.geometry);
const jstsGeoJSONReader = new GeoJSONReader();
const jstsGeoJSONWriter = new GeoJSONWriter();
const jstsGeom = jstsGeoJSONReader.read(drawGeoJSON);
const jstsbBufferedGeom = BufferOp.bufferOp(jstsGeom, this._bufferValue);
const bufferedDraw = geoJSONParser.read(jstsGeoJSONWriter.write(jstsbBufferedGeom));
// Draw buffer
this._bufferLayer.addFeatures(bufferedDraw);
this._bufferLayer.redraw(true);
}
for (const featureType of this.allFeatureTypeSelected) {
mainLizmap.lizmap3.selectLayerFeaturesFromSelectionFeature(featureType, this.featureDrawnBuffered || selectionFeature, this._geomOperator);
}
}
}
},