谷歌地图每次都无法在地图上放置一些标记
我试图在自定义谷歌地图上放置 130/140 个标记。
我用 jquery 和 gmaps 注入地图(http://gmap.nurtext.de/) 每次,随机地(与特定标记无关)没有显示很多标记。
firebug 报告此错误:
a is null
此错误来自此文件:
http://maps.gstatic.com/intl/it_ALL/mapfiles/285c/maps2.api/main.js
如果我刷新页面...其他一些标记是“隐藏”的,而其他标记则显示。
有人遇到这个问题/可以帮助我或建议另一种安全的方法来显示所有标记吗?
多谢!
编辑: 这就是我注入地图和标记的方式(有很多地址,但在这个例子中只有很少)
$(document).ready(function()
{
$("#container").gMap(
{
scrollwheel: false,
maptype: G_PHYSICAL_MAP,
icon:
{
image: "files/images/gmap_pin.png",
iconsize: [32, 37],
iconanchor: [32, 37],
infowindowanchor: [12, 0]
},
address: "Milano",
zoom: 4,
markers:
[
{ address: "Viale Certosa, Milano" },
{ address: "Viale Ceccarini, Milano" },
{ address: "Viale Italia, Milano" },
{ address: "Via Rodi, Milano" },
]
});
});
im trying to place like 130/140 markers on a custom google map.
i inject the map with jquery and gmaps (http://gmap.nurtext.de/)
everytime, at random (not related to specific markers) a lots of markers are not shown.
firebug report this error:
a is null
and this error comes from this file:
http://maps.gstatic.com/intl/it_ALL/mapfiles/285c/maps2.api/main.js
if i refresh the page...some other markers are "hidden" and other ones are shown.
anyone had this problem/can help me or suggest another safe way to show all markers?
thanks a lot!
EDIT:
this is how i inject the map and the markers (with a lots of address, but in this example only few)
$(document).ready(function()
{
$("#container").gMap(
{
scrollwheel: false,
maptype: G_PHYSICAL_MAP,
icon:
{
image: "files/images/gmap_pin.png",
iconsize: [32, 37],
iconanchor: [32, 37],
infowindowanchor: [12, 0]
},
address: "Milano",
zoom: 4,
markers:
[
{ address: "Viale Certosa, Milano" },
{ address: "Viale Ceccarini, Milano" },
{ address: "Viale Italia, Milano" },
{ address: "Via Rodi, Milano" },
]
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在插件本身。
它尝试从 gmaps 获取地理编码。但是,如果 gmaps 响应存在一些延迟,则没有回调可以停止循环请求。
the problem is in the plugin itself.
it try to get from gmaps the geocodes..but there is no callback that stop the cycled requests if there is some latency in the gmaps responses.