How can I cluster markers without overlap with google maps?

走远了吗. 提交于 2019-11-29 15:39:40
geocodezip

Look at the OverlappingMarkerSpiderfier

See this post on integrating it with MarkerClusterer

I had a similar (albeit not exactly the same) problem.

I needed to draw sample points in a plot chart. But I found collisions (exact overlap for some points coming from coarser lectures) and aliasing artifacts (partial overlaps with repeating some fixed amount of displacement due also to coarser lectures).

I decided to introduce some random displacements to all of the points. The "noise" had a normal distribution with a variance two times smaller than the variance of the measured error of the sample, so it did not change add significant variance to the perceived sample. The result was a much clearer chart, more informative, and nicer.

Applying this experience in your case, I would detect exact overlaps in Lat Long and for those I would add some random Lat and Long, effectively moving the point a bit away of its original position and thus avoiding the exact overlap.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!