> Hmmm...changed the names but no luck...any other possibilities?
Do you not read the javascript errors? just now it says 'markersfoo
has no properties' and points at this line -
markersfoo.push(markerOnMap);
So, lets look at whats wrong with that.
Earlier on we have -
var markersfoo;
which defines it as a plain ordinary one-dimensional variable. When
we try to do a .push() on it later, it fails because markersfoo is not
an array.
Replace your 'empty variable' creation with
var markersfoo = [];
which will make an 'empty array' instead, which will accept .push()
actions.
While we're changing things, look at ...
for (var i = 0; i < markersXml.length; ++i) {
....
markersfoo.push(markerOnMap);
markerCluster = new MarkerClusterer(map, markersfoo);
}
This will push each new marker onto the array, and give the array to
the clusterer ... every time around the loop, with the array getting
one longer each time and including the previous markers already added.
This -
for (var i = 0; i < markersXml.length; ++i) {
....
markersfoo.push(markerOnMap);
}
markerCluster = new MarkerClusterer(map, markersfoo);
would push each marker onto the array until the loop is finished, and
then give the completed array to clusterer just once.
cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---