# 图层管理

<sm-web-map :map-options="mapOptions">
  <sm-layer-manager position="top-left" :layers="layers"></sm-layer-manager>
</sm-web-map>

<script>
new Vue({
  el: '#main',
  data() {
    return {
      layers: [
        {
          title: '直辖市',
          children: [
            {
              title: '上海',
              mapInfo: {
                serverUrl: 'https://www.supermapol.com/',
                mapId: 394538195,
                layerFilter: function(layer) {
                  if (layer.name === '上海_县级行政区划图@公众数据') {
                    return true;
                  }
                  return false;
                }
              }
            }
          ]
        }
      ]
    };
  }
});
</script>

# Attributes

参数 说明 类型 可选值 默认值
layers treeNodes 数据 layer[ ] - -
replaceFields 替换 treeNode 中 title,key,children 字段为 treeData 中对应的字段 object {children:'children', title:'title', key:'key' } -
defaultExpandAll 默认展开所有树节点 boolean - false
iconClass 收缩按钮的 Font class 类名 string - 'sm-components-icon-layer-manager'
headerName 标题名 string - '图层管理'

支持主题混入参数卡片混入参数Control 混入参数

# layer

参数 说明 类型 可选值 默认值
title 标题 string - -
children 子节点数据 array - -
mapInfo 地图配置对象 mapInfo - -
visible 地图是否初始加载 boolean - -

# mapInfo

参数 说明 类型 可选值 默认值
serverUrl SuperMap iPortal/Online 服务器地址 string - https://www.supermapol.com
mapId iPortal Online 地图 ID number - -
mapOptions MapboxGL map options 对象 (opens new window) object - -
withCredentials 是否携带 cookie boolean - false
layerFilter 判断图层是否加载 function - function() { return true}
最后更新时间: 2024/11/1 下午6:26:51
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy