Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps V3 rendering over 1 million markers (in a reasonable time)

I have recently created a Google Map using V3 of the API (latest version). One of my requirements is that I am able to render over 1 million markers (in a reasonable time). A reasonable time would be under 15 seconds.

I know that it is fairly crazy to render all 1 million markers at once which is why I have investigated performance options. One of the options I came across and utilized is the MarkerClusterer: https://developers.google.com/maps/articles/toomanymarkers

However, I am now starting to see performance issues when testing the MarkerClusterer with over 100,000 markers as it is taking a long time to render the map and markers (1 min+). Eventually, I have managed to make the page crash with around 200,000 markers.

Is there any way to improve the performance of the map when using this many markers?

Thanks in advance for any help.

like image 802
Jiminy Avatar asked Mar 17 '14 09:03

Jiminy


People also ask

What is the maximum number of markers on Google Maps?

WP Google Maps supports a theoretically unlimited number of markers, the only practical limitations are your servers resources and the performance of your target audiences devices. The plugin will easily handle 3,200 locations.

Which is the preferred method for handling large numbers of markers?

Which is the preferred method for handling large numbers of markers is to store the data in? As it turns out, the Android Maps Util Library https://github.com/googlemaps/android-maps-utils seems to be the number one choice when clustering markers.

What do the markers mean on Google Maps?

A marker identifies a location on a map. By default, a marker uses a standard image. Markers can display custom images, in which case they are usually referred to as "icons." Markers and icons are objects of type Marker .

How do I move a marker smoothly on Google Maps?

The initialize() function creates a Google Map with a marker. The transition() and moveMarker() are used to move marker smoothly on click on the Google map.


2 Answers

I had similar challenge of showing a million+ points on map.

Made use of elastic search clustering on server side and leaflet cluster on the client side.

May be this be helpful..

Demo here

Check the code here

like image 82
Cyril Cherian Avatar answered Nov 01 '22 21:11

Cyril Cherian


I have used Google Fusion Tables successfully and it is very fast and quite simple - once you work out how to use OAuth2....

The tables are limited to 100,000 entries each and you upload them from a CSV file - either by going to your Google Drive in a browser or programmatically using curl or Perl.

To get beyond the 100,000 element limit, you can add 5 layers to your map but that will still only get you to 500,000 points. Can't suggest anything more than that.

My project is here if you want a look.

like image 25
Mark Setchell Avatar answered Nov 01 '22 22:11

Mark Setchell