diff --git a/01/index.html b/01/index.html index b74bf6b..ad2042e 100644 --- a/01/index.html +++ b/01/index.html @@ -4147,37 +4147,7 @@ window._tmpM.setIcon(createModernMarker(color, 'fas fa-gas-pump', 'SPBU Baru')); }; - function handlePointClick(e) { - const icon = createModernMarker('#10b981', 'fas fa-gas-pump', 'SPBU Baru'); - const tmpM = L.marker(e.latlng, { icon, draggable: true }).addTo(map); - const upd = ll => { - const a = document.getElementById('p-lat'), b = document.getElementById('p-lng'); - if (a) a.value = ll.lat.toFixed(6); - if (b) b.value = ll.lng.toFixed(6); - }; - tmpM.on('dragend', ev => upd(ev.target.getLatLng())); - const form = `
-

Tambah SPBU

- - - - - - -
- - -
-
* Geser marker untuk menyesuaikan posisi
- -
`; - tmpM.bindPopup(form, { maxWidth: 280, autoPanPaddingTopLeft: [0, 80], autoPanPaddingBottomRight: [0, 20] }).openPopup(); - tmpM.on('popupclose', () => { if (map.hasLayer(tmpM)) map.removeLayer(tmpM); }); - window._tmpM = tmpM; - } + @@ -4605,14 +4575,8 @@ } function fmtArea(m) { return m >= 10000 ? (m / 10000).toFixed(2) + ' ha' : Math.round(m) + ' m²' } - function clearTemp() { - state.tempPoints = []; state.drawingLine = false; state.drawingPoly = false; - state.tempMarkers.forEach(m => map.removeLayer(m)); state.tempMarkers = []; - if (state.tempPolyline) { map.removeLayer(state.tempPolyline); state.tempPolyline = null; } - if (state.tempPolygon) { map.removeLayer(state.tempPolygon); state.tempPolygon = null; } - } + function cancelDrawing() { - clearTemp(); if (window._tmpM) { map.removeLayer(window._tmpM); window._tmpM = null; } if (window._tmpC) { map.removeLayer(window._tmpC); window._tmpC = null; } } diff --git a/index_original.html b/index_original.html new file mode 100644 index 0000000..7b15f1c Binary files /dev/null and b/index_original.html differ