Is possible to get a reference to the google.maps.Map object for a given DOM element?
No, it's not possible to get an already instantiated map given a DOM element.
I usually work around in one of two ways, created a global map variable or passing the map variable around between functions as needed. If you're working with multiple maps on a page, you could probably create your own map registry that handled simple DOM id -> map variable lookups.
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