I reviewed the answer of this questions about leaflet markers filter using a dropdown menu. Can anyone help on how to change the color of the marker when one of the dropdown item is selected? For instance, green marker when 'banking' is selected and red marker when 'hospitality' is selected. In which part of the script do I put this instruction?
I tried this to get green marker but couldnt change the default blue. This changes all markes to green instead of one of the selected item
if (latitude) {
// Add a new marker to the cluster group and bind a pop-up
markers.addLayer(L.marker([latitude, longitude], {icon: greenIcon})
.bindPopup(popText));
};