Google-maps – How to tweak the Google Maps app to display polygons/markers based on zoom level

google maps

I've created a hideous and slow Google Map at:

http://test.barrycarter.info/gmap4.html

The markers represent temperatures at given locations, and the
polygons represent a Voronoi diagram of the temperatures (sample data:
not accurate).

Question: is there something Google Maps API can do automatically to
display less information at one time? For example, not displaying all
the markers or every single polygon, even the really small ones?

I realize I could tweak my app to display polygons/markers based on
zoom level, but is there a way to make Google Maps API do the work?

Best Answer

You need to cluster your markers. It's tedious to do on the server side, but there are a few client-side clustering plugins you can use. The most popular one is MarkerClusterer.

MarkerClusterer v3:

Why many markers degrade performance, and how to improve it (MarkerClusterer comes out tops):