views:

86

answers:

1

After searching SO and multiple articles I haven't found a solution to my problem.

What I am trying to achieve is to load 20,000 markers on Google Maps.

R-Tree seems like a good approach but it's only helpful when searching for points within the visible part of the map. When the map is zoomed out it will return all of the points and...crash the browser.

There is also the problem with dragging the map and at the end of dragging re-running the query.

I would like to know how I can use R-Tree and be able to achieve the all of the above.

A: 

As noted, R-Tree won't help you when you're looking at a zoomed-out view. This problem is often addressed by marker clustering, because showing 20,000 points in a browser window isn't that useful.

Marker Manager is an open source javascript library which addresses this, but there are others.

With a very great number of markers, you may need to look at server-side clustering, (where R-Tree may come in handy!). Here is one discussion of it, and its google cache because link is dead at time of writing.

tcarobruce
I know Marker Manager - it's good for up to 2000 markers. Server-side clustering might be necessary but my question is how to combine both solutions to accomplish what I need. Re-running clustering on each drag of the map or zoom will be very slow.
Eeyore