Reputation: 1127
Below is my draw marker code in which I want to add custom icon.
drawMarker: function() {
this.drawnItems.clearLayers();
this.drawHandler = new L.Draw.Marker(this.map,this.drawControl.options.draw.marker);
L.Draw.Marker.options.icon ="/assets/image/marker.png";
this.drawHandler.enable();
},
But custom icon code is not working.
Upvotes: 0
Views: 305
Reputation: 1127
I have just replaced below line
this.drawHandler = new L.Draw.Marker(this.map, {icon:L.icon({iconUrl:'/assets/image/marker.png'})});
And it worked.
Upvotes: 1