簡體   English   中英

Google Maps API V3:多個標記和Ajax信息窗口? (最棒的表演)

[英]Google Maps API V3 : multiple markers and ajax infowindows? (best performance)

我一直在使用出色的$ GoMap jquery插件 ,該插件基本上是google maps API V3的包裝器。 它為我提供了很好的服務,但是當使用大量的60多個標記時,似乎存在一些性能問題,因此我決定是時候直接使用V3 API了。

我已經閱讀了一些初學者教程,但是考慮到我對性能的追求,我想讓您的想法/摘要是在V3 API中原生實現以下效果的最有效方法...(但適用於60多個標記)

$(function() { 
    $("#map").goMap({ 
        maptype: 'ROADMAP',
        mapTypeControl: false, 
        zoom: 9,
        markers: [        {  
            latitude: 52.941364, 
            longitude: 0.648730,         
            html: { 
                content: '<img src="http://localhost/gv2010/user_area/assets/js/carousel/loader.gif"/>',
                ajax: 'http://localhost/gv2010/maptest/ajax/gmap_window.php?job_id=4002&img=40%2Fj4002_i2523&name=B%26b+With+Tlc&village=Brancaster&url_str=bandbwithtlc&rooms_num=&sleeps_text='
            } 
        },                {  
            latitude: 52.963097, 
            longitude: 0.742940,         
            html: { 
                content: '<img src="http://localhost/gv2010/user_area/assets/js/carousel/loader.gif"/>',
                ajax: 'http://localhost/gv2010/maptest/ajax/gmap_window.php?job_id=4003&img=40%2Fj4003_i2358&name=Scolt+Cottage&village=Burnham+Overy+Staithe&url_str=scoltcottage&rooms_num=&sleeps_text='
            } 
        },                {  
            latitude: 52.904720, 
            longitude: 0.623171,         
            html: { 
                content: '<img src="http://localhost/gv2010/user_area/assets/js/carousel/loader.gif"/>',
                ajax: 'http://localhost/gv2010/maptest/ajax/gmap_window.php?job_id=4200&img=42%2Fj4200_i4599&name=1+Ringers+Cottage&village=Docking&url_str=1-ringers-cottage&rooms_num=&sleeps_text='
            } 
        }
        ],
        icon: 'map_marker.png'        
    }); 
}); 

任何幫助真的很感激

如何使用標記聚類器 ?先檢查此速度測試 另外,請檢查此答案以獲取有關如何直接使用google maps api的一些示例代碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM