5

I need to display a set of markers on a google map. In addition, I need to show additional markers, loaded dynamically, when the user pans the maps.

The number of markers could be in thousands, out of which 30-50 need to be displayed initially. Other markers need to be loaded and displayed only when user pans over an area that contains markers. I thought about using marker managers but i am not sure if markers can be fed to the marker manager dynamically. I want something more like this map. Notice how images load when you pan the map and garbage-collected when you pan away.

Marker clustering is not important but might be nice.

1 Answer 1

2

I am doing this with clustering on a dataset of several thousand markers. This is how I'm doing it: When the 'moveend' event is fired, I get the bounds of the map and send an ajax request to the server. I get the markers from your DB which are in the bounds and send them back to the client. If you have questions about a specific part of the process, just let me know.

Also, with the Marker Manager, I believe that you can add markers dynamically.

Sign up to request clarification or add additional context in comments.

4 Comments

Got it! I wonder if it is possible to use marker manager with AJAX instead of writing my own moveend implementation? Markermanager takes care of few others chores I think.
The only drawback to Marker Manager is that it doesn't cluster. You just tell it which markers you want to be visible at which zoom, and it shows/hides them as you move around.
Clustering is not required, I am asked to lock the zoom and show all markers. Problem solved!
how do you prevent the markers that have already been loaded from being loaded again as part of the ajax request?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.