如果元素在同一位置或堆叠,如何设置群集? [英] How to set cluster if elements are at same place or stacked?

查看:77
本文介绍了如果元素在同一位置或堆叠,如何设置群集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Leaflet的新手,我正在寻找标记簇解决方案. 我在地图上有元素,但是很少有元素位于同一位置,所以它们躲在后面,在地图上看起来只有一个元素.

I am new for Leaflet, I am looking for marker cluster solution. I have elements on the map, but few elements are located at the same place so they are hiding behind and on map it looks like there is only one element.

我需要的东西:仅当元素堆叠/放置在同一位置时,才需要标记簇.

What I need : I need marker cluster only if elements are stacked/located at the same place.

请提出建议.

谢谢

推荐答案

标记群集将调整maxClusterRadius选项(数字尽可能小)即可解决您的问题

Marker cluster will solve your problem if you tune the maxClusterRadius option (number as small as possible)

var markers = L.markerClusterGroup({ maxClusterRadius: 1 });

此选项(默认为80像素)说明在将标记聚类之前标记之间应有多近.

This option (defaulted to 80 pixels) says how near markers should be from each other before clustering them.

这篇关于如果元素在同一位置或堆叠,如何设置群集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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