diff --git a/app/static/app/js/classes/plugins/Map.js b/app/static/app/js/classes/plugins/Map.js index 72668fa7f..6575093cc 100644 --- a/app/static/app/js/classes/plugins/Map.js +++ b/app/static/app/js/classes/plugins/Map.js @@ -28,7 +28,8 @@ export default { "updateAnnotation", "deleteAnnotation", "toggleAnnotation", - "annotationDeleted" + "annotationDeleted", + "downloadAnnotations" ] }; diff --git a/app/static/app/js/components/LayersControlAnnotations.jsx b/app/static/app/js/components/LayersControlAnnotations.jsx index 585746542..a6835b75a 100644 --- a/app/static/app/js/components/LayersControlAnnotations.jsx +++ b/app/static/app/js/components/LayersControlAnnotations.jsx @@ -120,6 +120,21 @@ export default class LayersControlAnnotations extends React.Component { } } + handleExportGeoJSON = e => { + if (PluginsAPI.Map.downloadAnnotations("geojson")) return; + else{ + // TODO? + } + } + + handleDelete = () => { + if (window.confirm(_('Are you sure you want to delete this?'))){ + this.props.layers.forEach(layer => { + PluginsAPI.Map.deleteAnnotation(layer); + }); + } + } + render(){ const { layers } = this.props; @@ -129,8 +144,8 @@ export default class LayersControlAnnotations extends React.Component {
{_("Annotations")}
- - + +