类名 MapVLayer

# new MapVLayer(options)

MapV图层

参数:

名称 类型 描述
options Object

构造参数

mapVOptions Object

mapV的构造参数

data Object

数据源

继承关系

成员变量

Collection

# readonly allSublayers

所有子图层对象信息

Inherited From:
Polygon | Extent | Circle | MultiPolygon | null

# clippingArea

空间裁剪范围

Inherited From:
Object

# readonly currentStyleInfo

当前的矢量瓦片样式信息,包含serviceUrl 、styleUrl 、spriteUrl 、glyphsUrl 以及style

Inherited From:
Object

# readonly data

MapV的元数据

String

# labelsRenderMode

指定矢量瓦片注记的渲染模式,仅在三维上有效; on-screen: 使用Cesium接口实时渲染注记; off-screen: 使用矢量瓦片来绘制注记; 请注意模式切换时,会造成性能损失,在显卡较弱的机器上会出现卡顿现象;

Inherited From:
Object

# readonly mapVOptions

mapV的构造参数

Number

# mvtExtent

mvt矢量瓦片相对坐标范围,默认为4096,表示矢量瓦片相对坐标的范围为0到4096

Inherited From:
Default Value:
  • 4096
Collection

# sublayers

子图层列表对象

Inherited From:
TileInfo

# readonly tileInfo

瓦片切图信息

Inherited From:
String

# readonly title

图层名称

LayerType

# readonly type

图层类型

Overrides:
String

# url

矢量瓦片服务地址

Inherited From:

方法

# static fromJSON(json)

通过json构造MapVLayer对象

参数:

名称 类型 描述
json Object

json对象

MapVLayer实例

MapVLayer

# _initMapInfo(customStyle)

初始化mapInfo

参数:

名称 类型 描述
customStyle *
Inherited From:
*

# clone()

克隆并返回一个新图层

Overrides:

新的图层对象

MapVLayer

# findSublayerById(sublayerID)

根据子图层id查询图层

参数:

名称 类型 描述
sublayerID String

图层ID

Inherited From:

子图层

示例

根据子图层id查询图层

// ES5引入方式
const { IGSVectorTileLayer } = zondy.layer
// ES6引入方式
import { IGSVectorTileLayer} from "@mapgis/webclient-common"
const igsVectorTileLayer = new IGSVectorTileLayer({
  // 服务基地址
  url: 'http://{ip}:{port}/igs/rest/services/{serviceName}/VectorTileServer'
});
map.add(igsVectorTileLayer);
// 根据id获取子图层
const subLayer = igsVectorTileLayer.findSublayerById('子图层id')

# getStyleLayerVisibility(styleLayerId)

获取样式图层可见性

参数:

名称 类型 描述
styleLayerId String

样式图层id

Inherited From:

样式图层可见性状态

Boolean

# toJSON()

将图层转为json对象

Overrides:

josn对象

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