Home > Mobile >  Capture basic parameters of a google map presented on a web page in a frame
Capture basic parameters of a google map presented on a web page in a frame

Time:10-25

I have a google map displayed in an iframe on a web page. I manipulate the map through scrolling and zooming etc. When The map is displaying what I want to see (location and zoom) how do you capture that data programmatically (using javascript for instance)? I want to have the user click a button which captures that data and can then use it in another application. An example of this would be when you are on a google maps page in a browser, that info is contained in the URL at the top of the browser page. As you navigate on a map zooming and scrolling, the URL updates accordingly.

CodePudding user response:

You should be using the Google maps Javascript api, this allows you to programmatically set and get map data. check out this example: https://developers.google.com/maps/documentation/javascript/examples/event-click-latlng

  • Related