reactjs - 使用 Leaflet 自定义 Bing 地图
问题描述
我在 React JS 应用程序的 Bing 地图之上使用 Leaflet 库。我想为道路、水等应用自定义颜色。为此,我使用了以下代码。但这对我不起作用。
let customStyles = {
"waterPoint": { "iconColor": "#a1e0ff" },
"transportation": { "strokeColor": "#aa6de0" },
"road": { "fillColor": "#b892db" },
"railway": { "strokeColor": "#a495b2" },
"structure": { "fillColor": "#ffffff" },
"runway": { "fillColor": "#ff7fed" },
"area": { "fillColor": "#f39ebd" },
"political": { "borderStrokeColor": "#fe6850", "borderOutlineColor": "#55ffff" },
"point": { "iconColor": "#ffffff", "fillColor": "#FF6FA0", "strokeColor": "#DB4680" },
"transit": { "fillColor": "#AA6DE0" }
}
'Default': L.bingLayer({
key: 'my_private_key',
imagerySet: 'CanvasDark',
culture: 'en-US',
type: 'AerialWithLabels',
style: customStyles
}
我已使用以下 URL 进行参考。 https://docs.microsoft.com/en-us/previous-versions/mt823632(v=msdn.10)?redirectedfrom=MSDN
有人可以帮我吗?
解决方案
我已经使用了以下自定义,它满足了我的要求。
let baseLayers = {
'Default': L.bingLayer({
key: 'my-access-key',
imagerySet: 'RoadOnDemand',
culture: 'en-US',
style: 'wt|fc:28fa3c;lbc:a0a1a1;loc:111505_ar|fc:474747_trs|fc:222527;lbc:a0a1a1;loc:000505;sc:0_g|lc:2f3133;srv:0;lbc:a0a1a1;loc:000505'
})
}
推荐阅读
- excel - 过滤列不包含
- ios - 此 iPhone 6 运行 iOS 11.3.1 (15E302),此版本的 Xcode 可能不支持
- html - 如何在 `datetime-local` 中删除 1985-04-12`T`23:20:50
- php - JSON -> PHP 中的多维数组 -> SQL
- java - Tomcat 8.5 ServletException JSP 文件未找到(但 100% 存在)
- google-apps-script - 使用复选框和 TRUE/FALSE 单元格值隐藏工作表
- javascript - jQuery 选择 div 元素包含在 php 文件中?
- javascript - Highcharts第二个yAxis不会缩放到百分比
- highcharts - 热图系列名称不显示
- r - 如何在 R 中展平深度且不规则嵌套的列表/数据框/JSON