On Jul 6, 3:06 pm, Christine <[email protected]> wrote: > > Is there any way to either disable the creation of a new marker (only) > while an info window is open, or to abort the old marker and move on > to the new marker?
One way of doing this might be to have a global variable like var makeNewMarker; and then when you open your infoWindow set makeNewMarker = true; in your map's click listener, test for makeNewMarker. If makeNewMarker is true, you could clear up the half-done marker (and then set makeNewMarker to false, because you're no longer doing that; or keep it as true and make a new marker). When you have successfully finished creating a marker, make sure makeNewMarker is set to false so that your map listener doesn't attempt to clear up a half-done marker. You *can* create and destroy listeners at will, but it's usually easier to set flags like this to determine how they should work; and it's less prone to memory leaks. 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 -~----------~----~----~----~------~----~------~--~---
