Cre*_*rem 5 javascript google-maps google-maps-api-3
这是我的 Google 地图“设置”
我想扩展并显示最多 10k 个标记(使用 MarkerClusterer)。最好的方法是什么?
我正在考虑将所有标记数据写入一个文件(作为 javascript 数组或 xml)并从那里读取 javascript,因为在数据库中查询 10k 个位置是不切实际的。你有其他建议吗?
我应该使用相同的循环槽数组并一次放置一个标记吗?我查看了 kml 图层,但似乎我无法导航槽标记(我有上一个/下一个位置功能)并且我可能无法使用 infobox.js ?
有什么建议吗?
正如 @geocodezip 提到的,请查看该文档,而不是查看集群解决方案,请查看视口标记管理部分。
如果您的数据库支持地理空间查询,您可以请求在地图发布后仅返回给定范围内的标记idle。
google.maps.event.addListener(map, 'idle', function(){
var bounds = map.getBounds(); //returns an object with the NorthEast and SouthWest LatLng points of the bounds
//make the AJAX request passing in your `bounds`
/*in the AJAX callback remove the current markers from the map and the cluster object,
and add the new ones along with their event handlers and re-add to the cluster object as well*/
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8429 次 |
| 最近记录: |