gpt4 book ai didi

javascript - Google Maps API V3 : multiple markers and ajax infowindows?(最佳性能)

转载 作者:行者123 更新时间:2023-11-30 06:47:44 26 4
gpt4 key购买 nike

我一直在使用优秀的 $GoMap jquery plugin这基本上是 google maps API V3 的包装器。它对我很有用,但是当使用大量 60+ 标记时,似乎会出现一些性能问题,所以我决定是时候直接使用 V3 API 了。

我已经阅读了相当多的初学者教程,但考虑到我追求的是性能,我想让你的想法/片段是在 V3 API 中 native 实现以下目标的最有效方法......(但对于 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'
});
});

非常感谢任何帮助

最佳答案

如何使用 marker clusterer ?检查this speed test第一的。另请查看 this answer有关如何直接使用 google maps api 的一些示例代码。

关于javascript - Google Maps API V3 : multiple markers and ajax infowindows?(最佳性能),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4746394/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com