avasin avasin - 11 months ago 96
Javascript Question

Remove shadow from standard marker in leaflet maps?

Is it possible to remove shadow from standard marker in leaflet maps?

Answer Source

In source code new L.Icon.Default() is used: https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Marker.js#L10

So, it can be achieved following way:

var icon = new L.Icon.Default();
icon.options.shadowSize = [0,0];
var marker = new L.Marker(map.getCenter(), {icon : icon}).addTo(MyMap);