Google Maps Api v3 - 新的 MarkerClusterer 运行速度太慢?
为了创建地图聚类器,我使用:
markerClustererGPC = new MarkerClusterer(myMap.map, markersGPC, GPCOptions);
但有时它不起作用,并且markerClustererGPC有时未定义。
我搜索这个问题,并意识到(看起来)服务器有时太快,并且因此未定义集群。
如果服务器有点旧(慢),它可以正常工作。
我的说法正确吗?我该怎么做才能避免这个问题,使我的代码适合在任何服务器上工作?
to create map clusterer, i use:
markerClustererGPC = new MarkerClusterer(myMap.map, markersGPC, GPCOptions);
but sometimes it does not works, and markerClustererGPC is sometimes undefined.
i search on this problem, and realise that (it looks like) server is sometimes too fast, and cluster is not defined due to that.
if server is a bit older (slower), it works without problems.
am i right about this? what can i do to avoid this problem, to make my code proper to work on any server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为因为谷歌地图未加载完成,所以你的地图无法识别。
尝试添加这个:
在您调用创建地图后(地图对于谷歌地图是可变的)
i think because google map is not loaded completed so your map is unidentified.
Try add this:
after your call for creating map (map is variable for google map)