Is there a way to get the corresponding DOM element of a Marker or Layer with Leaflet, like it is with Google Maps?
Get the DOM element associated with a Leaflet class
8k views Asked by hugo der hungrige At
2
Is there a way to get the corresponding DOM element of a Marker or Layer with Leaflet, like it is with Google Maps?
You can use the internal
._containerproperty 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.