Fix parcel coordinates and map controls
This commit is contained in:
1 parent
8997f1b728
commit
56211e4b25
9 files changed
+220
-14
No files matched your search
@@ -31,6 +31,7 @@ window.lmeMap = {
|
||||
clearImported,
|
||||
addProjectMarker,
|
||||
enableDrawTools,
|
||||
clearDrawings,
|
||||
saveWorkspace,
|
||||
loadWorkspace,
|
||||
setBaseLayer,
|
||||
@@ -58,11 +59,13 @@ function init() {
|
||||
L.control.zoom({ position: "bottomright" }).addTo(lmeState.map);
|
||||
|
||||
lmeState.baseLayers.osm = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||
maxNativeZoom: 19,
|
||||
maxZoom: 22,
|
||||
attribution: "© OpenStreetMap contributors"
|
||||
});
|
||||
|
||||
lmeState.baseLayers.satellite = L.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
|
||||
maxNativeZoom: 19,
|
||||
maxZoom: 22,
|
||||
attribution: "Tiles © Esri"
|
||||
});
|
||||
@@ -288,6 +291,22 @@ function enableDrawTools() {
|
||||
setInfo("Disegno attivo: crea POI, linee e aree sulla mappa.");
|
||||
}
|
||||
|
||||
function clearDrawings() {
|
||||
const count = lmeState.drawings.getLayers().length;
|
||||
if (!count) {
|
||||
setInfo("Non ci sono disegni o POI da eliminare.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window.confirm(`Eliminare ${count} disegni e POI dalla mappa?`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
lmeState.drawings.clearLayers();
|
||||
updateGpsInsideState();
|
||||
setInfo("Disegni e POI eliminati dalla mappa.");
|
||||
}
|
||||
|
||||
function saveWorkspace() {
|
||||
const data = {
|
||||
drawings: lmeState.drawings.toGeoJSON(),
|
||||
|
||||
Reference in new issue
Block a user