Is there a way to get the corresponding DOM element of a Marker or Layer with Leaflet, like it is with Google Maps?
getContainer()
is a more formal way to get at the DOM element, but is only available on the Map, TileLayer, and Controls classes.
You can use the internal ._container
property on most Leaflet objects, like layers and markers. Note that it's internal for a reason - if you use Canvas mode or Leaflet decides to change its internal API, your code will break.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With