1
Mengubah gaya default pada layer GeoJSON di Leaflet?
Saya perlu mengubah gaya pada layer GeoJSON titik di peta Leaflet. Saya menggunakan kode berikut: function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) { layer.bindPopup(feature.properties.popupContent); } } var myStyle = { "color": "#ff7800", "weight": 5, "opacity": 0.65 }; myGeoJSONLayer = L.geoJson(myGeoJSON, { style: myStyle, onEachFeature: onEachFeature, }); myGeoJSONLayer.addTo(map); Semua berfungsi …