Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove shadow from standard marker in leaflet maps?

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

like image 346
avasin Avatar asked May 31 '14 18:05

avasin


1 Answers

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(map);
like image 127
avasin Avatar answered Nov 09 '22 15:11

avasin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!