shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
722 stars 289 forks source link

How to avoid default pushpin icon in Text Marker? #275

Closed AntoniBCN closed 6 years ago

AntoniBCN commented 6 years ago

Hello,

Is possible to add a Text Marker with only text without the pushpin icon?

Thanks in advance

brunob commented 6 years ago

Try this ;)

var marker = new L.Marker.Text(map.getCenter(), 'Sweet!', {icon: L.icon({iconUrl: 'nope.png'})});
AntoniBCN commented 6 years ago

Nice solution ! It works perfectly. Thanks a lot.