类名 IGSVectorTileSubLayer

# new IGSVectorTileSubLayer(options)

IGS矢量瓦片子图层

参数:

名称 类型 默认值 描述
options Object

构造参数

renderer BaseRenderer

专题图渲染样式对象,支持如下渲染样式:
1、单值渲染
2、分段渲染
3、统一专题图
示例请参考IGSVectorTileLayer

id String

矢量瓦片子图层的id,当加载MapGIS制作并由IGS发布的矢量瓦片时,如果矢量瓦片样式中有mapinfo参数,则子图层ID对应的是MapX中的图层索引; 如果没有mapinfo参数,则子图层ID对应的是矢量瓦片样式图层ID;当加载第三方发布的矢量瓦片时,子图层ID对应的是矢量瓦片样式图层ID;

title String

矢量瓦片子图层的标题

styleLayers Array.<Object>

矢量瓦片子图层关联的矢量瓦片样式图层数组

visible Boolean true

图层可见性

layer IGSVectorTileLayer

矢量瓦片父图层

labelingInfo Array.<LabelClass> []

仅当IGSVectorTileLayer图层的labelsRenderMode参数设置非'off-screen'属性时生效
为性能考虑,当前所有子图层labelingInfo内的LabelClass必须保证其renderMode参数一致,不支持renderMode同时设置label或canvas两种模式
三维注记目前不支持修改透明度和显隐参数
参考示例:[矢量瓦片三维注记][切换三维注记样式]

示例

矢量瓦片三维注记

// ES5引入方式
const { LabelClass } = zondy
const { IGSVectorTileLayer } = zondy.layer
// ES6引入方式
import { IGSVectorTileLayer, LabelClass } from "@mapgis/webclient-common"
// 初始化一个额外的图标DOM对象
const iconImage = new Image()
iconImage.src = '图片地址或者base64字符串'
// 初始化矢量瓦片图层
const igsVectorTileLayer = new IGSVectorTileLayer({
  // 矢量瓦片基地址
  url: '',
  // 开启三维注记
  labelsRenderMode: 'on-screen',
  // 设置要应用三维主句的子图层
  sublayers: [{
    // 矢量瓦片子图层id
    id: '矢量瓦片子图层id',
    // 注记参数,目前仅用填写一个
    labelingInfo: [
      new LabelClass({
        symbol: {
          // 填充颜色 rgba or 16进制颜色
          color: 'rgba(255,255,255,1)',
          // 描边颜色
          haloColor: 'rgba(0,0,0,0.5)',
          // 描边宽度
          haloSize: 2,
          // 行高
          lineHeight: 1.1,
          // 文本间距
          letterSpacing: 2,
          // 字体样式 参考css
          font: {
            size: 14,
            family: '微软雅黑',
            weight: 'normal',
            style: 'normal'
          },
          // 额外的图标
          textExtraIcon: iconImage,
          // 图标的大小
          textExtraIconSize:20,
          // 图标方位
          textExtraIconAnchor:'left'
        },
        // 渲染方式 1.canvas 2.label 3.ground
        renderMode: 'canvas',
        // 最大可见范围
        minScale: 60000000,
        // 最小可见范围
        maxScale: 1,
        // 布局位置 可选 1.above-left 2.above-center 3.above-right 4.center-left 5.center-center 6.center-right 7.below-left 8.below-center 9.below-right
        labelPlacement: 'above-center',
        // 高程采样参数
        elevationInfo: {
          mode: 'OnTheGround',
          offset: 0
        }
      })
    ]
  }]
});

切换三维注记样式

// ES5引入方式
const { LabelClass } = zondy
// ES6引入方式
import { LabelClass } from "@mapgis/webclient-common"
// 初始化一个额外的图标DOM对象
const iconImage = new Image()
iconImage.src = '图片地址或者base64字符串'
// 获取矢量瓦片子图层
const sublayer = igsVectorTileLayer.findSublayerById('子图层id')
// 设置一个新的矢量瓦片三维注记参数
sublayer.labelingInfo = [
  new LabelClass({
    symbol: {
      // 填充颜色 rgba or 16进制颜色
      color: 'rgba(1,255,1,1)',
      // 描边颜色
      haloColor: 'rgba(0,0,0,0.5)',
      // 描边宽度
      haloSize: 2,
      // 行高
      lineHeight: 1.1,
      // 文本间距
      letterSpacing: 2,
      // 字体样式 参考css
      font: {
        size: 14,
        family: '微软雅黑',
        weight: 'normal',
        style: 'normal'
      },
      // 额外的图标
      textExtraIcon: iconImage,
      // 图标的大小
      textExtraIconSize:20,
      // 图标方位
      textExtraIconAnchor:'left'
    },
    // 渲染方式 1.canvas 2.label 3.ground
    renderMode: 'canvas',
    // 最大可见范围
    minScale: 60000000,
    // 最小可见范围
    maxScale: 1,
    // 布局位置 可选 1.above-left 2.above-center 3.above-right 4.center-left 5.center-center 6.center-right 7.below-left 8.below-center 9.below-right
    labelPlacement: 'above-center',
    // 高程采样参数
    elevationInfo: {
      mode: 'OnTheGround',
      offset: 0
    }
  })
]

继承关系

成员变量

Array.<LabelClass>

# labelingInfo

三维注记参数,仅当igs矢量瓦片图层labelsRenderMode设置非'off-screen'属性时生效。为性能考虑,当前所有子图层labelingInfo内labelClass必须保证renderMode一致,不支持同时设置label或canvas两种形式。

Inherited From:
UniqueValueRenderer | ClassBreakRenderer | SimpleRenderer

# renderer

矢量瓦片子图层专题图渲染样式

Inherited From:
String

# readonly type

图层的类型

Overrides:
Boolean

# visible

矢量瓦片子图层是否可见

Inherited From:
Default Value:
  • true

方法

# static fromJSON(json)

通过json对象初始化该对象

参数:

名称 类型 描述
json Object

json对象

IGSVectorTileSubLayer 新的IGSVectorTileSubLayer图层对象

# clone()

克隆图层对象

Overrides:

克隆后的图层对象

# toJSON()

将图层转为json对象

Inherited From:

json对象

Object
构造函数
成员变量
方法
事件