I have a geojson file which has marker-color properties in it. In this case I want to call the marker color contained in the GeoJSON file, to change the marker color. how to do this?
GeoJSON data:
{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{"markercolor":"#1e7e7e","marker-size":"medium","marker-symbol":"","title":"Indonesia"},
"geometry":{"type":"Point","coordinates":[107.9296875,-6.664607562172573]}
},
{
"type":"Feature",
"properties":{},
"geometry":{"type":"Point","coordinates":[114.873046875,4.565473550710278]}
},
Leaflet php code:
L.geoJSON(data,{
pointToLayer: function (feature, latlng) {
return new L.circleMarker(latlng, {
radius: 8,
fillColor: "#7e7e7e",
weight: 1,
opacity: 1,
fillOpacity: 0.8,
});
},
onEachFeature:onEachFeature
}).addTo(mymap);
});