[Google Maps API v3] Re: Only want ONE PLACEMARK to be able to be added!

2011-05-27 Thread kt
The error if I don't declare marker as a global variable is: test4.html:30 Uncaught ReferenceError: marker is not defined If I DO declare marker, then it's: Uncaught TypeError: Cannot call method 'lng' of undefined Here's the entire js code: //Defines global variables var map; var marker; //C

[Google Maps API v3] Only want ONE PLACEMARK to be able to be added!

2011-05-26 Thread kt
I'm trying to use the code on this Samples page, but I only want to allow ONE MARKER to be created, NOT multiple: http://code.google.com/apis/maps/documentation/javascript/examples/event-arguments.html I tried this 'while' loop, but it didn't work. I even tried declaring variable outside of func