Hi,
I have successfully created several markers on google maps using GMaps API.
But now i want to open google maps web when i click on a marker.
I also need smart zoom level to optimize the zoom to show all markers on the map.
Can you help?
Thank you.
Hi Pedro,
Regarding your first question, in order to associate a specific url to a marker and open it when clicking in that marker you can follow the steps bellow:
"{ ... url: 'https://www.google.com/maps/search/?api=1&query=38.7527152,-9.1869627&query_place_id=ChIJcQzF3dUyGQ0RGojgiz9LlPA' }"
"function() { ... window.open(this.url); }"
As for the second question, to adjust the zoom to show all markers, you should first "set a boundary" by using the action AddMarkerToBounds for every marker you wish to include in that zoom level. Then, in order to readjust the zoom level, you can simply use the action FitMapToBounds.
Hope it helps. Best Regards,
Luís