Google Maps V3 Overlapping Markers on exact Location

后端 未结 6 791
陌清茗
陌清茗 2021-02-19 07:45

I am having issues with markers overlapping, please do not down vote as I am not highly schooled in javascript also I have looked at the different answers offered on stackoverfl

6条回答
  •  情歌与酒
    2021-02-19 07:58

    Add small random numbers to the marker latitude and longitude.

    This displaces the overlapping markers around their correct position. When zoomed in, the markers will separate. Smaller random numbers improve accuracy but more zooming in is needed. Also alter the marker icon or label to indicate it's overlapping.

    In this example, four different markers are used. If there are more than 4 overlapping points, the slight randomization is added.

    Example: http://waveneyramblers.org.uk/walks/next_eight_days

    View source to see the JavaScript.

提交回复
热议问题