开发者

Google Maps API V3 - Load map first and then load markers

I am creating a page to show a list of locations(markers) on Google maps. The number of markers is dynam开发者_Python百科ic and can be quite large. This will adversely affect user experience when the map (along with the markers) are taking too long to load.

Can anyone point me in the right direction to load the map first and then load the markers. Any help much appreciated.


Use a marker manager. I used one for Google Maps API v2 (for on-demand loading of ~2000 markers via AJAX) and I am sure there's one for API v3. A marker manager is class that allows you to selectively display markers on a Google Map. Instead of adding markers to map, you use add them to the marker manager and it takes care of when and how to display the markers. The markers that lie outside the "visible" region are removed hence its fairly memory efficient. A marker manager class may provide "clustering" option (or may be you need another class for this). A cluster manager displays one marker that encompasses multiple markers when markers are too close, specially at high zoom level. Hope this helps you in the right direction.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜