Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding thousands of Markers Google Map API V3

I am currently putting together a demo application that needs to show 28,000 markers on a map without using any type of clustering. The problem is, adding the marker to the map for that many takes so long that the browser crashes! Here is the current process

-Retrieves map points from database including LAT and LONG (doesn't have to geocode) - for loop cycles through each of the returned values and does this:

  var marker = new google.maps.Marker({
                 position: point,
                 animation: google.maps.Animation.DROP,
                 map: map,
                 title: value.Title,
                 icon: icons['store']
             });

             google.maps.event.addListener(marker, 'click', function () {
                 var hidingMarker = currentPlace;
                 var slideIn = function (marker) {
                     $('#Name', info).text(place.Title);
                     $('#Phone', info).text(place.Description);
                     $('#Address', info).text(place.Proper_Address);
                     $('#LastSale', info).text("Last Sale:" + place.Last_Sale);
                     info.animate({ right: '0%' });
                 }

-the markers drop in and the user can click on any of them to see a little bit of information

Is there a more efficient way to do this so that showing 28,000 would be possible without having to cluster them? I have found some scripts people wrote to handle it before, but they are all for api V2. Any links or code is greatly appreciated! thanks!

like image 948
mscard02 Avatar asked Mar 30 '12 14:03

mscard02


People also ask

How many markers can Google Maps API handle?

2048 characters in URL is just under 100 GeoCode values. So, again no more than 100 markers.

How many markers can you add to Google Maps?

Add a place A map can have up to 10,000 lines, shapes, or places. Select a layer and click where to put the place. A layer can have 2,000 lines, shapes, or places.


1 Answers

In my experience, the only real way to show that many markers on the map at the same time is to use fusion tables (which does have some limitations and other challenges that need to be worked around). All other solutions for handling this many markers involve some form of clustering or will not work with wide zoom.

http://www.google.com/fusiontables/Home/

like image 149
javram Avatar answered Sep 25 '22 13:09

javram