I am using Leaflet Slider, of Dennis Wilhelm, to show changes in data on a Leaflet map.
I am trying to change the change the marker icon but not getting it right. So,How
Just in case if anyone is wondering how to do it in Typescript with vue2-leaflet, below is one sample code. You can even use v-for on l-marker to plot multiple markers in one go:
// inside template
mdi-target
// default icon in script
defaultIcon = L.icon({
iconUrl: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png",
shadowUrl: require('../static/marker.png'),
iconSize: [20, 30],
iconAnchor: [18, 18],
popupAnchor: [0, -10],
shadowSize: [0, 0],
shadowAnchor: [10, 10]
});