menambahkan jalan dan parsil di portal

This commit is contained in:
z0rayy
2026-06-11 00:38:46 +07:00
parent 4928f53982
commit b027f02cf0
5 changed files with 627 additions and 8 deletions
+13 -3
View File
@@ -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: `<div class="marker-halo ibadah"></div><div class="marker-icon-inner">🕌</div>`, iconSize: [28, 28], iconAnchor: [14, 14], popupAnchor: [0, -14] }) })
.bindPopup(`