I have circle markers on my leaflet map using the below code which all works fine.
However I want to show the markers in a different color based on the attribute field named 'stype'.
Any help or guidance on how I can achieve this?
function siteslabels (feature, layer){
layer.bindPopup("<p class='info header'>"+
"<b>" + feature.properties.SITE + "</b>" +
"</br>" + feature.properties.Address1 +
"</br>" + feature.properties.stype +
"</p>");
};
var geojsonMarkerOptions = {
radius: 8,
fillColor: 'green',
color: 'black',
weight: 1,
opacity: 1,
fillOpacity: 0.8
};
L.geoJson(sites, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, geojsonMarkerOptions);
},
onEachFeature: siteslabels
}).addTo(map);