GoogleMaps API v3 - Need help with two "click" event scenarios. Need similar functionality to v2 AP
Posted
by Nathan Raley
on Stack Overflow
See other posts from Stack Overflow
or by Nathan Raley
Published on 2010-06-11T18:18:48Z
Indexed on
2010/06/11
18:22 UTC
Read the original article
Hit count: 222
google-maps
|google-maps-v3
In version 2 of the API the map click event returned an Overlay, LatLng, Overlaylatlng.
I used this to create a generic map event that would either retrieve the coordinates of the Map click event, or return the coordinates of a Marker or other type of Overlay.
Now that API v3 doesn't return the Overlay or Overlaylatlng during the map click event, how can I go about creating a generic "click" event for the map that works if the user clicks on a marker or overlay? I really don't want to create a click event for each marker I have on my page as I am creating anywhere from a handful to a couple thousand markers.
Also, I had to create a custom ImageMapType in order to display the StreetViewOverlay like we could do in v2 of the API because I couldn't find anywhere that told me how to add the StreetViewOverlay without the pegman icon. How can I go about retrieving the LatLng coordinates of a click on this overlay type as well?
© Stack Overflow or respective owner