Hi Mike, A million thanks to you for taking special interest in my code and figuring out the problems. I have made the changes suggested by you and now the site seems to be working as desired.
Regards, Hari On Jan 25, 2:59 pm, Mike Williams <[email protected]> wrote: > The reason that your markers don't display the marker context menu when > first clicked is that you haven't yet called createContextMenuMarker() > on that marker. What currently happens when you first click on a marker > is: > > 1. The map listener in ContextMenuMap doesn't check to see if the click > came from an overlay, and displays the map context menu. > > 2. The map listener in JScriptMain triggers the custom event on the > marker > > 3. The marker listener in JScriptMain highlights the marker and calls > createContextMenuMarker(). > > 4. createContextMenuMarker() creates a "singlerightclick" listener on > the marker (but doesn't trigger it). That listener doesn't receive the > current "singlerightclick" event because that's already happened. > > The second time you click on the marker, all that gate repeated > (creating a second "singlerightclick" listener on the same marker) but > also the first "singlerightclick" marker listener receives the event > and: > > 5. The marker "singlerightclick" listener in ContextMenuMarker.js gets > triggered, displays the marker context menu and hides the map context > menu. > > I suggest scrapping both parts of the custom "SingleRightClick" event > processing, and call createContextMenuMarker() when you create the > marker. > > -- > Mike Williams -- 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.
