diff --git a/apps/main/templates/create_layer.html b/apps/main/templates/create_layer.html index 192178b..63e159b 100644 --- a/apps/main/templates/create_layer.html +++ b/apps/main/templates/create_layer.html @@ -701,15 +701,18 @@ reader.readAsText(file); } }); - document.getElementById('exportGeoJSON').addEventListener('click', function () { - if (vectorLayer) { - const features = vectorLayer.getSource().getFeatures(); - const geojson = new ol.format.GeoJSON().writeFeatures(features, { - featureProjection: 'EPSG:3857' - }); - downloadGeoJSON(geojson); - } - }); + {% if request.user.is_superuser %} + const exportGeoJSONButton = document.getElementById('exportGeoJSON') + exportGeoJSONButton.addEventListener('click', function () { + if (vectorLayer) { + const features = vectorLayer.getSource().getFeatures(); + const geojson = new ol.format.GeoJSON().writeFeatures(features, { + featureProjection: 'EPSG:3857' + }); + downloadGeoJSON(geojson); + } + }); + {% endif %} function getCoordinates(entity) { if (entity.type === 'LINE') {