简体   繁体   English

Google Maps API V3:多个标记和Ajax信息窗口? (最棒的表演)

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

I've been using the excellent $GoMap jquery plugin which is basically a wrapper for google maps API V3. 我一直在使用出色的$ GoMap jquery插件 ,该插件基本上是google maps API V3的包装器。 It has served me well but when using lots of markers 60+ there seem to be some performance issues, so i've decided it's time to use the V3 API directly. 它为我提供了很好的服务,但是当使用大量的60多个标记时,似乎存在一些性能问题,因此我决定是时候直接使用V3 API了。

I've read a fair few beginners tutorials but considerring I'm after performance I'd like to get your thoughts/snippets the most efficient way of achieving the following natively in the V3 API...(but for 60+ markers) 我已经阅读了一些初学者教程,但是考虑到我对性能的追求,我想让您的想法/摘要是在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'        
    }); 
}); 

any help really appreciated 任何帮助真的很感激

How about using the marker clusterer ?Check this speed test first. 如何使用标记聚类器 ?先检查此速度测试 Also please check this answer for some sample code of how you can use the google maps api directly. 另外,请检查此答案以获取有关如何直接使用google maps api的一些示例代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM