Mapbox决定重叠顺序 [英] Mapbox deciding overlap order

查看:57
本文介绍了Mapbox决定重叠顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在地图上有一些以图标显示的功能.我想确定哪些图标应该隐藏,当它们在数字字段上发生碰撞时应该显示哪些图标,我的地图上的每个要素都具有该图标(参见图片).我找到了一个名为"symbol-sort-key"的mapbox属性,但我不知道这是否正确.symbol-sort-key需要一个数字,但是我不知道这个数字应该指的是什么.任何想法如何解决这个问题?

I have some features on the map displayed as icons. I want to decide which icons should be hidden and which should be displayed when they collide on a numeric field, that each feature on my map has (see picture). I've found a mapbox property called "symbol-sort-key", but I can't figure out if it's the right thing. symbol-sort-key takes a number, but I don't know to what this number should refer to. Any ideas how to solve this problem?

推荐答案

是的,symbol-sort-key 可能就是你想要的.它用于确定绘制符号的顺序,如果符号重叠并且允许碰撞(最高获胜),则影响绘制在顶部的符号;如果不允许碰撞(最低获胜),则绘制的符号是唯一绘制的.

Yes, symbol-sort-key is probably what you want. It's used to determine the order in which symbols are drawn, which affects which one is drawn on top if they overlap and collisions are allowed (highest number wins) or which is the only one drawn if collisions aren't allowed (lowest number wins).

文档中的 number 是指数字类型.因此,如果您拥有一个称为"priority"的数字属性,则可以指定以下内容:

The number in the documentation refers to a numeric type. So if if you have a property called "priority", which is numeric, you'd specify something like:

"symbol-sort-key": ["to-number", ["get", "priority"]],

这篇关于Mapbox决定重叠顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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