I'm aiming to customize my markers (leaflet maps) into 3 different colours based on different values in an attribute column. Each marker is assigned a value A-C and I would like to represent each value as a different colour marker. I have been trying to use a switch statement but cannot seem to get it to work, any tips?
here is my current code:
var customMarker = "A";
switch(Data[i].value){
case "A":
markercolor (orange);
break;
case "B":
markercolor (blue);
break;
case "C":
markercolor (green);
break;
default :
markercolor (pink);
}
var markerOptions = {
color: customMarker,
opacity: 1,
};
var marker = new L.circleMarker(markerLocation,markerOptions).addTo(map);
"A"
to marker which makes no sense. What is functionmarkercolor
doing? What are values oforange
,blue
etc. variables?