Note: Simular post to change default icon toolbar (Leaflet).
I am trying to add a custom icon for the leaflet Draw toolbar. But i can't seem to figure out how.
As seen on the image, I have two markers. The goal is to change one of the icons in the toolbar. My code is the following:
L.DrawToolbar.include({
getModeHandlers: function (map) {
return [
{
enabled: true,
handler: new L.Draw.Polyline(map, { metric: true, repeatMode: true }),
title: '...'
},
{
enabled: true,
handler: new L.Draw.Polygon(map, { allowIntersection: false, showArea: true, metric: true, repeatMode: false }),
title: '...'
},
{
enabled: true,
handler: new L.Draw.Marker(map, { icon: new L.Icon.Default() }),
title: '...'
},
{
enabled: true,
handler: new L.Draw.Marker(map, { icon: new L.Icon.Default() }),
title: '...'
}
];
}
});