2013-04-29 89 views
0

我搜索了google和本網站的解決方案,並嘗試了很多方法,但其中沒有一個解決了我的問題。使用Google Maps API v3載入數千個針腳(多標記)

我正在使用一種標準方法將多標記添加到使用javascript的GMaps應用程序中。我發現在一定數量的引腳(1000+)之後,引腳不再顯示在地圖上:(

我的問題:是否可以使用Google地圖加載1000到10000個引腳?

是否有人可以解釋爲什麼與谷歌地圖API V3 ??

銷假設谷歌地圖不支持我的要求,用於加載銷十萬的限制,是否有可以加載任何其他類似的API成千上萬的針腳??

回答

-1

我覺得沒有這樣的限制,查看本頁面:

https://code.google.com/apis/ajax/playground/#markers - 我成功加載此谷歌地圖上標記10000:

function initialize() { 
    if (GBrowserIsCompatible()) { 
    var map = new GMap2(document.getElementById("map_canvas")); 
    map.setCenter(new GLatLng(37.4419, -122.1419), 13); 

    // Add 10 markers to the map at random locations 
    var bounds = map.getBounds(); 
    var southWest = bounds.getSouthWest(); 
    var northEast = bounds.getNorthEast(); 
    var lngSpan = northEast.lng() - southWest.lng(); 
    var latSpan = northEast.lat() - southWest.lat(); 
    for (var i = 0; i < 10000; i++) { 
     var point = new GLatLng(southWest.lat() + latSpan * Math.random(), 
           southWest.lng() + lngSpan * Math.random()); 
     map.addOverlay(new GMarker(point)); 
    } 
    } 
} 

但是作爲標記的數量的增加,有可能需要更多的時間用於網絡瀏覽器來處理它們。