Hey guys,
I have a really strange problem right now.
markers
is an array of objects.
0
content (String)
coords (Object)
gMarker (Object)
1
content (String)
coords (Object)
gMarker (Object)
2
content (String)
coords (Object)
gMarker (Object)
So far, so good.
The problem:
console.dir(markers);
/**
* output as expected
*/
for(var i in markers) {
console.dir(markers[i]);
/**
* gMarker object is missing!
* markers[i] suddenly consists just of content and coords
*/
How can that be?
Edit: It must have had something to do with the "load" callback function of google maps. It fires a bit too early, at least in my case. I replaced that callback (GEvent.addListener(map, "load", callback_fn)) with a simple setTimeout that fires my callback function after 2 seconds, and now everything works as expected.
Either way, this does not explain why the gMarker property is not available inside that for-loop, that can not even be a race condition since the loop starts immediately after that point where the object is still OK.