相对于Mapbox GL JS中缩放级别的比例标记大小 [英] Scale marker size relative to the zoom level in Mapbox GL JS

查看:120
本文介绍了相对于Mapbox GL JS中缩放级别的比例标记大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当地图的缩放级别增加时,我想减小标记的大小.我该如何实现?

I want to decrease the size of the markers when the zoom level of the map is increased. How can I achieve this?

推荐答案

您可以将 interpolate 表达式与 zoom 表达式结合使用,

You can use the interpolate expression with the zoom expression, along these lines:

"icon-size": ['interpolate', ['linear'], ['zoom'], 10, 1, 15, 0.5]

此处的文档:https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#ramps-scales-curves

这篇关于相对于Mapbox GL JS中缩放级别的比例标记大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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