如何在此处的群集中显示重复的制造商地图 [英] How to display duplicate maker in cluster here map

查看:81
本文介绍了如何在此处的群集中显示重复的制造商地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里使用地图,并且在使用聚类.但是我对于显示​​坐标相同/dublicate的制造商有问题.当我放大clustering时,不幸的是制造商不可见,但集群仍然可见.群集缩放时如何显示这些制造商?

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 are not visible but cluster is still visible. How to display these makers when cluster is zoomed ?

我的群集选项如下

var clusteredDataProvider = new H.clustering.Provider(dataPoints, {
                clusteringOptions : {
                    eps : 16,
                    minWeight : 2
                },
                theme : new PusulaClusterTheme()
            });

推荐答案

我们遇到了同样的问题.可以这么说,如果您绝对需要标记来显示完全相同的点,那么我不知道您能做什么.但是我们想要显示街道上每栋房屋的标记,有时我们在一间房屋中有多个家庭,因此我们无法正确显示多个家庭.

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:

"...当您在同一地理位置放置多个标记时, 只是它们一个堆叠在另一个之上.因为他们都是 在同一坐标处,只会显示最上面的一个.所以 要使多个标记显示在同一坐标上,您将 需要有一些逻辑以避免标记重叠.没有 JS API中可以立即使用的方法,可以为您完成此操作,但也许 您可以使用方法地图.getObjectsat(X,Y)检查是否有 在这一点上已经没有任何标记.如果存在,则使用 一些逻辑来稍微改变新标记的坐标值 要添加到该点.

"...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.

我们最终复制了一个在Stackoverflow上找到的解决方案

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.

这篇关于如何在此处的群集中显示重复的制造商地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆