On Sep 10, 3:55 pm, EB <[email protected]> wrote: > How do I create a marker in a polygon. Anytime I mouse over the > polygon to create the marker, polygon gets the focus and click for a > marker doesn't generate any event.
Actually it does. A click on the polygon generates a click event on the polygon (are you listening for that?) and then a click on the map but passing the overlay, not the latlng (are you just expecting a latlng?) To get the map to respond to a click on the overlay, add a listener to the polygon and trigger a click on the map passing the latlng. > Also is there > a way to get a double click event on the polygon/polyline. When a > double click on the polygon happens, I want to initiate an AJAX call > to retrieve some data. There's no documented double-click event on polygons, although you may find an undocumented one works. If not, you need to imitate one by using the click event and a timeout. On click, check to see if the singleclick flag is set. - If it is not, set a singleclick flag and set a timeout to run the singleclick code after 300ms (or whatever value) - If it is set, this must be a double-click. Clear the timeout and run the doubleclick code. The single-click code must clear the flag. Because functions executed by setTimeout operate in global scope, the flag and other variables must be global too. Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en -~----------~----~----~----~------~----~------~--~---
