Hi,
I recently stumpled upon the possibilty of clustering Markers on a
google map (
http://googlegeodevelopers.blogspot.com/2009/04/markerclusterer-solution-to-too-many.html
).
However, I can't seem to figure out how to use the code right.
Currently my data is pulled from a MySQL database and then displayed
as markers on the map. That works fine with the help of GDownloadUrl.
Below is the code suggested for clustering, but I do not know how to
get my data in there.
>From my (probably wrong) point of view I should just have to change
the expression "data.photos[i].latitude" to get the data from my
generated xml file.
I would appreciate any help on how to do this.
Thanks!
Enrique.
if(GBrowserIsCompatible()) {
map = new GMap2($('map'));
map.setCenter(new GLatLng(39.91, 116.38), 2);
map.addControl(new GLargeMapControl());
var markers = [];
for (var i = 0; i < 100; ++i) {
var latlng = new GLatLng(data.photos[i].latitude,
data.photos[i].longitude);
var marker = new GMarker(latlng);
markers.push(marker);
}
var markerCluster = new MarkerClusterer(map, markers);
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.