What's the best way to add a big number of markers to a Google map cluster ?

Hello everybody.


I'm developing a web application and I want to add, more or less, 1500 markers to a Google map. I need advice on what's the best solution to load the markers. In the test I have done, first I load the markers and then I add them to a cluster, the solution works but visually it is a bit disappointing.

Is it possible to create the cluster first, and add the markers later, so the markers are not visible until you zoom in on the map?


Thanks a lot in advance


Before:


After:

Hi Francisco,

Have you tried to go with the documentation of Google? I would assume you need to include the JS about the clustering and make some development on the advanced options of the google maps component to make it work.

Cheers!

Tiago Gomes wrote:

Hi Francisco,

Have you tried to go with the documentation of Google? I would assume you need to include the JS about the clustering and make some development on the advanced options of the google maps component to make it work.

Cheers!

Hi Tiago, 

in fact it works, but the solution i get is not optimal. What i do is, i get a list of points from an aggregate, then i add one by one to the map, and at the end i add the full list to a cluster marker.

The reason of my question is if there is another solution that allows me to create the cluster at the begining of the processs, in order to add the markers to the cluster and at the end confirm the cluster. The target is to not display every marker one by one.


Thanks a lot