tags:

views:

274

answers:

2

Hello all

I am using google maps in my application. I have to show 100 markers on map.

First I prepared a markers array from these markers.

When markers are added using addOverlay from markers array, it takes some time and they are being added in some animated way (in sequence).

I want all of them to get added to map in a single shot, so no flickering effect.

I tried MarkerClusterer but it shows a cluster of markers where the need be. Instead I want all the markers to appear, not a cluster. Only they should be added faster.

var point = new GLatLng(latArr[i],lonArr[i]);

var marker = new GMarker(point,markerOptions);                              
markers[i] = marker;

var markerCluster = new MarkerClusterer(map, markers);

Any suggestions please? Thank you.

A: 

Few questions that would help...

1) The sample you have posted doesn't make sense can you provide more context with the loop?

2) What client is this on?

3) What version of the clusterer lib are you using.

I'm pushing over 6x times that number of points into this call where markerCollection is an array of GMarkers that is assembled ahead of time. No flicker.

markerCluster = new MarkerClusterer(map, markerCollection, clusterOptions);
Nick
A: 

Rather than using clusterer you should call the addOverlay(markers[i]) in a loop. That would work as fast as the javascript rendering engine can execute it.

vishwanath