Dynamically loading Google map icons as the map is scrolled
I have a web开发者_高级运维site 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:
http://www.globrix.com/property/buy/wr11%203dl?ns=true&rd=1&hits=10&br=buy&qt=wr11+3dl&keyword_field=
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?
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
精彩评论