Home>Support>Get google.maps.Map instance from a HTMLElement

Get google.maps.Map instance from a HTMLElement

I have been using the google maps widget, but now I want to make some buttons on the same page at the map that will zoom to markers I have created. The widget does not seem to have any functionality for this, so I have been trying to code my own.

It seems like I need to get the instance of the google.maps.Map that is created by the widget.

1) What is the name of the map instance the widget creates? I can’t seem to get through all the code while using chrome’s developer tools to find it.
2) Is it global such that I will be able to use other javascript to modify the map with button presses?
3) If it is not global, are there any suggestions on how to do this while still using the widget?

If not I guess I will have to try to make my own map the hard way :(

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 7 months ago Alex S
    Hi, I Work Here

    Hi Orangestorm87,

    I’ve sent your question to the development team. I should be able to report back with more information soon.

  2. 8 years, 7 months ago Alex S
    Hi, I Work Here

    Hi Orangestorm87,

    So I’ve heard back from the development team, and unfortunately, this isn’t possible right now. They have however stated they’ll be adding the ability to gain access to the map instance in an upcoming version. Please refer to the following GitHub issue for more information.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More