I am adding circles to a leaflet map. I was wondering if it was possible to change the color (and size of the radius) of the circle according to a continuous variable.
In the example below, it would be based on column 4 (i.e. scale 0 to 30). I know how to do it with leaflet and R (Shiny) but I can't find a way to do it in leaflet. I saw several examples with polygons, but not for circle.
var planes1 = [
["NotVisited",-104.0890764,49.04561272, 25 ],
["NotVisited",-104.4240635,49.09639175, 0 ],
["NotVisited",-103.1154144,49.13206467, 24 ],
["NotVisited",-104.014488,49.52543338, 30 ],
["Visited",-103.2220606,49.60741579, 5 ],
["NotVisited",-105.5253514,50.38853359, 6 ],
["Visited",-103.5139301,50.48490716, 22 ]
];
for (var i = 0; i < planes1.length; i++) {
circle = new L.circle([planes1[i][2],planes1[i][1]], 10, {
color: 'red',
fillColor:'blue',
fillOpacity: 1.0
})
.bindPopup(planes1[i][0])
.addTo(map1);
}