Monday, August 18, 2008

Gmaps: GEvent and "a is not defined"

I was getting the (generic and fairly common) "a is not defined" (on line 287 of main.js I believe) javascript error with gmaps when trying to add a GEvent click event listener. I intially thought it was an issue with my some map layers with ArcGIS Javascript Extension for Google Maps, but I resolved this issue by sticking the even handler in the initialize function. For some reason gmaps must not have been available at the scope of the even handler outside this function ... the gmap object was being instantiated inside this function, yet the variable was first declared outside the function in the first lines of the application ... strange.

No comments: