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²';