diff --git a/index.php b/index.php index ab02e25..50793cf 100644 --- a/index.php +++ b/index.php @@ -3,12 +3,12 @@ - WebGIS Portal - SPBU & Kemiskinan + WebGIS Portal - SPBU, Kemiskinan, Jalan & Parsil + + +
+ + +
+
+
+

Peta Jalan & Parsil Tanah

+
Visualisasi infrastruktur, kepemilikan lahan, dan akses parsil ke jalan
+
+
+ Memuat data... + +
+
+ +
+
+ +
+

Pencarian

+ +
+
+ +
+

Filter & Analisis

+
+ + + + +
+ + + + + + + + + + +
+ Klik satu parsil untuk melihat jalan terdekat dan estimasi jaraknya. +
+
+ +
+

Statistik Data

+
+
0
Total jalan tampil
+
0
Total parsil tampil
+
0 km
Akumulasi panjang jalan
+
0 m2
Akumulasi luas parsil
+
+
+ +
+

Legenda

+
Jalan Nasional
+
Jalan Provinsi
+
Jalan Kabupaten
+
Parsil SHM
+
Parsil HGB/HGU/HP
+
+
+
+
+ + + + + + diff --git a/js/map.js b/js/map.js index fb677dd..83d97ac 100644 --- a/js/map.js +++ b/js/map.js @@ -86,6 +86,10 @@ const LocateControl = L.Control.extend({ container.onclick = function(e) { e.stopPropagation(); + if (!window.isSecureContext) { + showToast('Fitur lokasi hanya tersedia melalui HTTPS.', 'error'); + return; + } showToast('Mencari lokasi...', 'success'); map.locate({ setView: true, maxZoom: 17, enableHighAccuracy: true }); } diff --git a/poverty.html b/poverty.html index 4645ac2..fdc2121 100644 --- a/poverty.html +++ b/poverty.html @@ -301,11 +301,21 @@ } window.updateRadius = function(id, val) { - ibadahRadiuses[id] = parseInt(val); + ibadahRadiuses[id] = parseInt(val, 10) || 0; + syncIbadahPoints(); renderBuffers(); renderMiskin(); }; + function syncIbadahPoints() { + ibadahPoints = []; + ibadahData.forEach(i => { + const lat = parseFloat(i.latitude), lng = parseFloat(i.longitude); + if (isNaN(lat) || isNaN(lng)) return; + ibadahPoints.push({ id: i.id, geom: [lng, lat], rad: ibadahRadiuses[i.id] || 0 }); + }); + } + function renderBuffers() { map.eachLayer(l => { if (l.options && l.options.isBuffer) map.removeLayer(l); }); ibadahData.forEach(item => { @@ -322,7 +332,8 @@ function renderAll() { renderIbadah(); renderBuffers(); renderMiskin(); } function renderIbadah(autoZoom = false) { - ibadahLayer.clearLayers(); ibadahPoints = []; + ibadahLayer.clearLayers(); + syncIbadahPoints(); const bounds = []; const f = document.getElementById('search-ibadah').value.toLowerCase(); ibadahData.forEach(i => { @@ -330,7 +341,6 @@ const lat = parseFloat(i.latitude), lng = parseFloat(i.longitude); if (isNaN(lat) || isNaN(lng)) return; const rVal = ibadahRadiuses[i.id] || 0; - ibadahPoints.push({ id: i.id, geom: [lng, lat], rad: rVal }); const marker = L.marker([lat, lng], { icon: L.divIcon({ className: 'custom-marker', html: `
🕌
`, iconSize: [28, 28], iconAnchor: [14, 14], popupAnchor: [0, -14] }) }) .bindPopup(` diff --git a/spbu.html b/spbu.html index e7df9cc..3d1e252 100644 --- a/spbu.html +++ b/spbu.html @@ -382,6 +382,9 @@ document.getElementById('btn-location').addEventListener('click', () => { if (!navigator.geolocation) return alert('Geolocation tidak didukung browser Anda.'); + if (!window.isSecureContext) { + return alert('Fitur lokasi hanya bisa digunakan melalui HTTPS. Buka situs dengan https:// atau gunakan localhost saat development.'); + } const btn = document.getElementById('btn-location'); btn.textContent = '⏳ Mencari lokasi...'; btn.disabled = true;