azure - Azure 室内地图显示单位替代名称 (nameAlt)
问题描述
我想问是否有办法在显示室内地图时显示单元的nameAlt而不是单元标签。
https://docs.microsoft.com/en-us/azure/azure-maps/drawing-package-guide 在绘图包指南中,它显示了单位标签,但我们如何也显示 nameAlt?
解决方案
我还没有找到任何关于它的文档。但是,我发现 Azure Indoor Maps 使用Mapbox GL JS作为渲染引擎。出于这个原因,在 Azure Indoor Maps 有更多文档之前,Mapbox GL JS 的一些文档似乎会有所帮助。https://www.mapbox.com/blog/azure-maps-adds-data-driven-styling-powered-by-mapbox-gl
在这种情况下,我们使用了 setLayoutProperty ( https://docs.mapbox.com/mapbox-gl-js/api/map/#map#setlayoutproperty和https://docs.mapbox.com/mapbox-gl-js /example/language-switch/ ) 方法来改变它。但是,我们不确定属性名称将来是否会更改,Azure Indoor Maps 处于预览状态,这种更改可能存在风险。
这是我们在项目中用于显示 nameAlt 属性的代码片段。
map.events.add('render', function (e) {
//Used the render function to get all the layers, including the layers for indoor maps.
//Set the nameAlt in the text-field instead of name in indoor_global_unit_label
map.map.setLayoutProperty('microsoft.maps.indoor.labels_indoor.indoor_global_unit_label', 'text-field', '{nameAlt}');
});
推荐阅读
- android - 如何在 Android 上获取视频的信息?
- c# - 有没有办法可以缓存 LINQ 参数并在以后重用它?
- python-3.x - sublime text 3 w Anaconda 构建 python,但不会显示 gui
- python - SSL:CERTIFICATE_VERIFY_FAILED 证书验证失败:主机名不匹配,证书对“url”无效
- reactjs - 无法使用 Intellij 运行反应应用程序
- openssl - 需要在 Windows 2008 r2 上添加密码套件
- flutter - 颤动中的自定义容器边框
- amazon-web-services - 更新CloudFormation模板时,如何解决“不兼容的启动模板:网络接口的设备索引必须为零”?
- javascript - JavaScript 中每个属性的预期 CSS 规范值类型
- go - 如何使用 go-git 签出新的本地分支?