leaflet pane

原创
04/10 10:45
阅读数 425

Map panes

Panes are DOM elements used to control the ordering of layers on the map. You can access panes with   map.getPane  or   map.getPanes  methods. New panes can be created with the   map.createPane  method. Every map has the following default panes that differ only in zIndex.

 

Pane Type Z-index Description
mapPane HTMLElement 'auto' Pane that contains all other map panes
tilePane HTMLElement 200 Pane for GridLayers and TileLayers
overlayPane HTMLElement 400 Pane for vectors (Paths, like Polylines and Polygons), ImageOverlays and VideoOverlays
shadowPane HTMLElement 500 Pane for overlay shadows (e.g. Marker shadows)
markerPane HTMLElement 600 Pane for Icons of Markers
tooltipPane HTMLElement 650 Pane for Tooltips.
popupPane HTMLElement 700 Pane for Popups.                                               

 

map.eachLayer(function (layer) {
    if (layer.options.pane == 'tooltipPane') {
        if (layer.options.className == 'tooltipName') {  //添加图层时加样式
            layer.remove();
        }
    }
})
let layerBoat = new L.marker(
          [latlngArr[i].currLat, latlngArr[i].currLng],
          {
            icon: new this.ShipIcon(),
            class:'custom-class'
          }
)

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部