Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
FreeDraw.onSetup = function() {
const polygon = this.newFeature({
type: Constants.geojsonTypes.FEATURE,
properties: {},
geometry: {
type: Constants.geojsonTypes.POLYGON,
coordinates: [[]]
}
});
this.addFeature(polygon);
this.clearSelectedFeatures();
doubleClickZoom.disable(this);
dragPan.disable(this);
this.updateUIClasses({ mouse: Constants.cursors.ADD });
this.activateUIButton(Constants.types.POLYGON);
this.setActionableState({
trash: true
CircleMode.onSetup = function(opts) {
const polygon = this.newFeature({
type: Constants.geojsonTypes.FEATURE,
properties: {
isCircle: true,
center: []
},
geometry: {
type: Constants.geojsonTypes.POLYGON,
coordinates: [[]]
}
});
this.addFeature(polygon);
this.clearSelectedFeatures();
doubleClickZoom.disable(this);
this.updateUIClasses({ mouse: Constants.cursors.ADD });
this.activateUIButton(Constants.types.POLYGON);
this.setActionableState({
trash: true
});
return {
initialRadiusInKm: opts.initialRadiusInKm || DEFAULT_RADIUS_IN_KM,
CircleMode.onSetup = function(opts) {
const polygon = this.newFeature({
type: Constants.geojsonTypes.FEATURE,
properties: {
isCircle: true,
center: []
},
geometry: {
type: Constants.geojsonTypes.POLYGON,
coordinates: [[]]
}
});
this.addFeature(polygon);
this.clearSelectedFeatures();
doubleClickZoom.disable(this);
this.updateUIClasses({ mouse: Constants.cursors.ADD });
this.activateUIButton(Constants.types.POLYGON);
FreeDraw.onSetup = function() {
const polygon = this.newFeature({
type: Constants.geojsonTypes.FEATURE,
properties: {},
geometry: {
type: Constants.geojsonTypes.POLYGON,
coordinates: [[]]
}
});
this.addFeature(polygon);
this.clearSelectedFeatures();
doubleClickZoom.disable(this);
dragPan.disable(this);
this.updateUIClasses({ mouse: Constants.cursors.ADD });
this.activateUIButton(Constants.types.POLYGON);
this.setActionableState({
trash: true
});
return {