使用 Leaflet 自定义 Bing 地图

Customize Bing map using Leaflet

我在 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'
    })
}