How to display duplicate maker in cluster here map

前端 未结 1 1085
名媛妹妹
名媛妹妹 2021-01-28 08:34

I am using here map and I use clustering. But I have problem for displaying maker whose cordinates are same /dublicate . When I zoom in clustering , unfortunately the makers a

相关标签:
1条回答
  • 2021-01-28 08:55

    We had the same issue. If you absolutely need the markers to show the exact very same spot up to the inch so to speak, then I don't know what you could do. But we wanted to show markers for each house on a street and sometimes we had multiple families in a house so we could not get the multiple ones to properly show.

    We opened a ticket with HERE and this was their reply:

    "...when you are placing multiple markers at the same geo-point, it is just that they are stacked one on top of the other. Since they are all at the same coordinate only the top most one will be displayed. So to enable multiple marker to be shown at the same coordinate, you will need to have some logic to avoid overlapping of markers. There is no method straight off the shelf in JS API that can do this for you, but maybe you can use the method map.getObjectsat(X,Y) to check if there are already any markers at the point. If there is an existing one, then use some logic to slightly change the coordinate value of the new marker to be added at the point.

    We ended up copying a solution we found here on Stackoverflow see this link that was written for Google Maps, but is just as relevant here with HERE. It uses a function to randomly change the last digit or 2 of the coordinates if they are multiple, and that way all your multiple coordinates will be a little bit unique and spaced out.

    0 讨论(0)
提交回复
热议问题