Collapsed Markers on Google Maps with MarkerClusterer

I am using GMaps V3 with MarkerClusterer from http://code.google.com/p/gmaps-utility-library-dev/

The markers displayed on the map are user-defined and often collapsed, so no matter how much you zoom in, the cluster always shows that there are several elements in one place. But the user should be able to click on each individual marker to see the info window. Do you know any way to handle this?

I tried to randomize the location a bit on the server, but the random case is not random enough, and the tokens continue to crash, just not so often.

+3
source share
3 answers

The answer to the OP comment in my previous answer, as it does not fit in the comment field:

This does not allow the cluster to group markers, but when the coordinates are identical, all markers remain at the same level with each other. Do you know about this workaround?

I think this is the expected behavior with Google maps - if the markers have exactly the same lat / lng, then you get markers on top of each other.

- , , lat/lng ( JS-), ( ) . . , , 15 "", ...

- "" , /lng. , , . "".

+3

"maxZoom", , maxZoom Google:

var markerCluster = new MarkerClusterer(map, markers, { maxZoom: 18 });
+4

When adding a marker, you can check if there are other markers in the same place, in which case you may notice that there are several markers.

0
source

Source: https://habr.com/ru/post/1773341/


All Articles