Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
y: coordinates[1]
},
style
}));
} else if (type === 'rectangle') {
annotation_layer.addAnnotation(rectangleAnnotation({
corners: _.map(coordinates[0], (coords) => {
return {
x: coords[0],
y: coords[1]
};
}),
style
}));
} else if (type === 'polygon') {
annotation_layer.addAnnotation(polygonAnnotation({
vertices: _.map(coordinates[0], (coords) => {
return {
x: coords[0],
y: coords[1]
};
}),
style
}));
} else {
console.error('Attempting to add annotation of type ' + type);
return false;
}
annotation_layer.geoOff(geo_event.annotation.add, _handler);
if (!annotation) {
console.error('GeoJS did not respond with a synchronous annotation event.');