Given my code below, I have added a non-pulsing marker to my map, using L.icon.pulse:
m = L.geoJSON(metaFeatures, {
pointToLayer: function (feature, latlng) {
var pulsingIcon = L.icon.pulse({
iconSize: [3, 3],
color: color,
fillColor: color,
animate: false,
});
var pulseMarker = L.marker(coordinates, { icon: pulsingIcon });
return pulseMarker;
//...
},
});
Later when I wish to change the animate:false to animate:true and change the color to red.
Note: if the marker was:
var circle = L.circleMarker(latlng, geojsonMarkerOptions);
I would be able to do: layer.setStyle({fillColor:'blue'}); and that would solve the problem but since this is a L.Marker it cannot be done.