超级集群:在集群中获取所有标记
我正在使用 superclsuter 用于在React Map中进行聚类标记,我想要的是从群集无论嵌套群集的嵌套水平如何。
为了更好地解释情况,一个集群可以在孩子们的时候有标记和其他簇,我需要弄平孩子簇以在其中获取标记。
cluster
marker
cluster(3 markers)
// this should return the 4 markers, the top-level marker, and markers within the child cluster
I'm using superclsuter for clustering markers in react native map, what I want is to get all children from a cluster no matter what level of nesting a cluster may have.
to explain the situation a little better, a cluster can have markers and other clusters as children, I need to flatten the child clusters to get markers inside them.
cluster
marker
cluster(3 markers)
// this should return the 4 markers, the top-level marker, and markers within the child cluster
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道答案很晚,但是此解决方案是使用Google-map-react软件包用于Google Map的。
首先初始化地图选项,添加maxzoom和minzoom。 Maxzoom必须等于超级集群Max-Zoom
使用此代码:
if(iscluster){
}
返回普通或自定义标记;
对于群集参考: https://www.leighhalliday.com/google-maps-maps-clustering
I know it is late for an answer, but this solution is for google map using google-map-react package.
First on initializing the map options, add maxZoom and minZoom. maxZoom must be equal to supercluster max-zoom
On cluster rendering use this code:
if(isCluster){
}
return Normal or Custom marker;
For cluster reference: https://www.leighhalliday.com/google-maps-clustering