sry for not reading instructions and pasting my problem. My problem is
in the marker removal part.
if (marker instanceof GMarker)
{
pos.apply(contextmenumarker);
contextmenumarker.style.visibility = "visible";
map.getContainer().appendChild(contextmenumarker);
//this is not working for me
GEvent.addDomListener
(contextmenumarker.firstChild, "click", function()
{
map.removeOverlay(marker);
contextmenumarker.style.visiibility
="hidden";
});
}
I hav uploaded the code at the following link:
http://ripun008.tripod.com/google%20maps/googlemaps.txt
i hope that u might be able to help me this time.
Thanks in advance
On May 11, 1:40 pm, "[email protected]" <[email protected]>
wrote:
> On May 11, 10:21 am, ripunjaya <[email protected]> wrote:
>
>
>
> > i wanted toremovea particularmarkerfrom a collection of markers
> > using the context menu. My application works in such a way that when
> > the user right clicks on any particularmarkera context menu appears
> > and when the user selects toremovethemarkerfrm the context menu,
> > then themarkershud get removed and the context menu shud disappear.
> > Besides if the user right-clicks on the map then the context menu shud
> > display the zoom in and out options. In either case the context menu
> > shud disappear after the user clicks on any option of his choice.
>
> > In my case themarkergets removed but the context menu does not
> > disappear and i get the error that 'a is not defined'. I am storing
> > all the markers in an array so that i can delete them easily but
> > somehow its not working. Similarly on right click on map the zoom in
> > and out work fine but the context menu does not disappear. My
> > Javascript is as follows:
>
> ...
>
>
>
> > Kindly help me out in this. I am struck on this big time. Any help
> > would be appreciated
>
> Kindly help us to help you. Follow the posting guidelines and post a
> link to your map rather than huge chunks of code...
>
> http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...
>
> It looks like you should have function closure on themarkervariable,
> so should be able toremoveit from the map, but I'm not going to
> study your code.
>
> -- Larry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---