【问题标题】:Leaflet : add layerGroup to specific pane传单:将 layerGroup 添加到特定窗格
【发布时间】:2022-09-28 20:39:48
【问题描述】:

下面的代码似乎不起作用,因为我的fournituresLayer groupLayer 中包含的每一层仍然有“覆盖窗格”作为参考。

let map = L.map(\'map\', {
    crs: L.CRS.Simple,
    attributionControl: false,
    dragging: true,
    keyboard: true,
}).setView([0, 0], 20);

map.createPane(\'fournituresPan\')
map.getPane(\'fournituresPan\').style.zIndex = 450;
map.getPane(\'fournituresPan\').style.pointerEvents = \'none\';

let buildingLayer = L.layerGroup([])
let fournituresLayer = L.layerGroup([], { pane : \'fournituresPan\'})
let electricityLayer = L.layerGroup([])

有人知道如何将 layerGroup 添加到特定的 Pane 吗?

    标签: leaflet pane


    【解决方案1】:

    当您将图层组添加到地图时,只需使用选项“窗格”设置 PaneName

        L.layerGroup([], { pane: 'markerPane' }).addTo(this.map)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多