new IGSVectorTileSubLayer(options)
document/layer/igserver/IGSVectorTileSubLayer.js, line 6
IGS矢量瓦片子图层
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
构造参数
|
Examples
// 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
}
})
]
Extends
Members
-
labelingInfoArray.<LabelClass>
-
三维注记参数,仅当igs矢量瓦片图层labelsRenderMode设置非'off-screen'属性时生效。为性能考虑,当前所有子图层labelingInfo内labelClass必须保证renderMode一致,不支持同时设置label或canvas两种形式。
-
originLayerTypeSeverVectorTileSubLayerType
-
原始图层的类型。目前有两种类型GroupLayer、SFeatureLayer。
-
矢量瓦片子图层专题图渲染样式
-
styleLayersArray.<Object>
-
矢量瓦片子图层关联的矢量瓦片样式图层
-
typeSubLayerType
-
图层类型
-
visibleBoolean
-
矢量瓦片子图层是否可见
- Default Value: true
Methods
-
IGSVectorTileSubLayer.fromJSON(json)
document/layer/igserver/IGSVectorTileSubLayer.js, line 212 -
通过json对象初始化该对象
Name Type Description jsonObject json对象
Returns:
IGSVectorTileSubLayer 新的IGSVectorTileSubLayer图层对象 -
clone(){IGSVectorTileSubLayer}
document/layer/igserver/IGSVectorTileSubLayer.js, line 220 -
克隆图层对象
Returns:
Type Description IGSVectorTileSubLayer 克隆后的图层对象 -
inherited toJSON(){Object}
document/layer/baseLayer/VectorTileSubLayer.js, line 301 -
将图层转为json对象
Returns:
Type Description Object json对象