开发者

Google Maps Api v3 - new MarkerClusterer works too slow?

to create map clusterer, i use:

markerClustererGPC = new MarkerClusterer(myMap.map, markersGPC, GPCOptions);

but sometimes it does not works, and markerClustererGPC is sometimes undefined.

i search on this problem, and realise that (it looks like) server is sometimes too fast, and cluster i开发者_如何学Pythons not defined due to that.

if server is a bit older (slower), it works without problems.

am i right about this? what can i do to avoid this problem, to make my code proper to work on any server?


i think because google map is not loaded completed so your map is unidentified. Try add this:

var isLoad = false;

google.maps.event.addListener(map,'tilesloaded', function () {

if (!isLoad) {

isLoad = true;
LoadClusterFunction();   

}

});

after your call for creating map (map is variable for google map)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜