mapbox - MapBox NumberFormat 预期语法
问题描述
我在 MapBox Studio 上苦苦挣扎
我需要格式化海拔并使用该numberFormat
功能。
但是,我没有成功找到正确的语法。文档很差。
到目前为止,我确实尝试过这样做:
number-format(elevation, {'locale':'fr'})
但它一直说语法不正确。尝试双引号,也尝试添加。
我找到了唯一的信息:
使用提供的格式规则将输入数字转换为字符串表示形式。如果设置,“code”参数指定要使用的语言环境,作为 BCP 47 语言标记。如果设置,则货币参数指定用于货币样式格式的 ISO 4217 代码。如果设置,则 min-fraction-digits 和 max-fraction-digits 参数指定要包含的最小和最大小数位数。
解决方案
使用的正确语法似乎记录在那里:https ://docs.mapbox.com/mapbox-gl-js/example/cluster-html/
根据我的需要,正确的做法是
[
'number-format',
['get', 'elevation'],
{ 'locale': 'fr' }
]
推荐阅读
- unity3d - 如何解决 Gradle 错误:碰撞属性
- java - 为每个 JSON 对象创建新按钮
- python - 尝试列出腌制数据时,我只获取上次存储的数据,如何显示所有腌制数据?
- java - MongoDB/Java:从查询中获取值的最有效方法
- swift - 如何正确地初始化()一个快速视图控制器?
- python - cyklus中变量的变量名
- javascript - 如何在 JavaScript 中将较大的文本变量格式化为较小的变量?
- css - 按钮a:悬停和背景颜色
- python-3.x - pandas 数据帧重建的时间优化(随机到固定采样)
- ssl - 通过 JNDI 命名服务器连接时如何为 Hornetq 客户端指定本地自定义 SSL 信任库