From b7d3327314c6280926f8f7821bda2024a9701a93 Mon Sep 17 00:00:00 2001 From: cindy Date: Wed, 10 Jun 2026 23:08:58 +0700 Subject: [PATCH] feat: initialize WebGIS dashboard for SPBU data management with Leaflet and custom sidebar UI --- 01SPBU/index.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/01SPBU/index.html b/01SPBU/index.html index c0ee9e3..015c48d 100644 --- a/01SPBU/index.html +++ b/01SPBU/index.html @@ -1209,10 +1209,10 @@
`; @@ -1648,7 +1648,14 @@ data.forEach(item => { try { const geojson = JSON.parse(item.geojson); - const layer = L.geoJSON(geojson, { style: { color: parsilColors[item.status]?.color || '#9C27B0', fillOpacity: 0.3, weight: 3 } }).addTo(parsilLayer); + // Normalisasi status untuk menangani data lama yang mungkin tersimpan dengan format panjang + let statusCode = item.status; + if (statusCode.includes('SHM')) statusCode = 'SHM'; + else if (statusCode.includes('HGB')) statusCode = 'HGB'; + else if (statusCode.includes('HGU')) statusCode = 'HGU'; + else if (statusCode.includes('HP')) statusCode = 'HP'; + + const layer = L.geoJSON(geojson, { style: { color: parsilColors[statusCode]?.color || '#9C27B0', fillOpacity: 0.3, weight: 3 } }).addTo(parsilLayer); let luas = parseFloat(item.luas); let luasText = luas >= 10000 ? (luas/10000).toFixed(2) + ' ha' : luas.toFixed(2) + ' m²';