当地图滚动时动态加载 Google 地图图标
我有一个网站,数据库中包含大约 50 万个地理编码位置。我希望人们能够通过地图搜索这些内容。显然,这对于标准的 Google(或者 Bing)地图显示来说太多了,即使使用像 MarkerClusterer 这样的东西也是如此。
因此,我想要做的是,当人们在地图上滚动时动态加载地图数据,这样就不会同时加载太多图标或太多数据。下面是一个已经执行类似操作的网站示例:
不幸的是,我不是一个足够熟练的 JavaScript 程序员来对代码进行逆向工程!所以我希望可能有一个开源项目可供我使用或改编。
我过去主要使用 Google 地图(该网站目前使用 Google 地图进行小区域搜索),但如果 Bing 更容易的话,我也会同样满意。后台全部用PHP。
有什么建议吗?
I have a website with around half a million geocoded locations in a database. I want people to be able to search for these via a map. Obviously, that's far too many for a standard Google (or, for that matter, Bing) map display, even when using something like MarkerClusterer.
What I want to do, therefore, is dynamically load the map data as people scroll around on the map so that there are never too many icons, or too much data, loaded at once. Here's an example of a site which already does something like this:
Unfortunately, I'm not a skilled enough javascript programmer to reverse engineer that code! So I was hoping that there might be an open source project which I can use or adapt instead.
I've mostly used Google maps in the past (and the site currently uses Google maps for small-area search), but I'd be equally happy with Bing if that's easier. The backend is all in PHP.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
监听地图上的“空闲”事件。
您将需要使用地图的边界进行某种空间查询。
另外,考虑使用 Fusion Table:
http://google.com/fusiontables
Listen for the 'idle' event on the Map.
You'll want to do some sort of spatial query, using the bounds of the Map.
Also, consider using Fusion Tables:
http://google.com/fusiontables