new IGSSceneLayer(options)
document/layer/igserver/IGSSceneLayer.js, line 12
IGS 场景服务图层(SceneServer / g3d)。
该图层用于加载 IGS 场景服务(支持 IGS 1.0 / 2.0),并在加载完成后生成:
scenes:场景集合(目前实现中通常只激活第一个场景)activeScene:当前激活的场景对象allSublayers:当前场景中所有子图层的扁平化集合
兼容性说明:当使用的 webclient-cesium 版本为 10.7.2.x 及以下时, 场景图层的 M3D 缓存子图层仅支持通过 URL 参数传递 token,不支持通过请求头(headers)传递认证信息。
限制说明:
- 子图层类型为地形(Terrain)时,不支持设置图层透明度(opacity)。
- 当前不支持加载栅格体元(Voxel)数据。
| Name | Type | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | {} |
可选
构造参数。
|
Examples
// ES5引入方式
const { IGSSceneLayer } = zondy.layer
// ES6引入方式
import { IGSSceneLayer } from "@mapgis/webclient-common"
const layer = new IGSSceneLayer({
// 服务基地址
url: '服务基地址'
// 设置场景初始化参数
scenes: [{
// 设置子图层初始化参数
sublayers: [{
// 子图层id
id: 'id',
// 子图层初始化参数
extensionOptions: {
// 开启自动跳转
autoReset: true
}
}]
}]
});
// ES5引入方式
const { IGSSceneLayer } = zondy.layer
const { UniqueValueRenderer } = zondy.renderer
const { SimpleFillSymbol,SimpleLineSymbol } = zondy.symbol
const { Color } = zondy
// ES6引入方式
import { IGSSceneLayer,UniqueValueRenderer,SimpleFillSymbol,SimpleLineSymbol,Color } from "@mapgis/webclient-common"
// 构造单值渲染器
const renderer = new UniqueValueRenderer({
// 专题图过滤字段名
field: "字段名",
// 单值专题图过滤条件数组
uniqueValueInfos: [
{
// 指定字段值
value: '过滤字段值1',
// 匹配到该值后的样式
// M3D专题图仅支持SimpleFillSymbol符号
symbol: new SimpleFillSymbol({
// 填充颜色
color: new Color(255, 0, 0)
})
},
{
// 指定字段值
value: '过滤字段值2',
// 匹配到该值后的样式
// M3D专题图仅支持SimpleFillSymbol符号
symbol: new SimpleFillSymbol({
// 填充颜色
color: 'rgb(255, 123, 220)'
})
}
]
})
// 构造场景图层
const layer = new IGSSceneLayer({
// 服务基地址
url: '服务基地址',
// 设置场景初始化参数
scenes: [{
// 设置子图层初始化参数
sublayers: [{
// 子图层id
id: 'id',
// 设置专题图渲染器
renderer: renderer,
// 子图层初始化参数
extensionOptions: {
// 开启自动跳转
autoReset: true
}
}]
}]
});
// ES5引入方式
const { IGSSceneLayer } = zondy.layer
const { ClassBreakRenderer } = zondy.renderer
const { SimpleFillSymbol } = zondy.symbol
const { Color } = zondy
// ES6引入方式
import { IGSSceneLayer,ClassBreakRenderer,SimpleFillSymbol,Color } from "@mapgis/webclient-common"
// 构造分段渲染器
const renderer = new ClassBreakRenderer({
// 专题图过滤字段名
field: "字段名",
// 分段专题图过滤条件数组
classBreakInfos: [
{
// 最小过滤范围,field对应的值大于等于minValue
minValue: 0,
// 最大过滤范围,field对应的值小于maxValue
maxValue: 2,
// 匹配到该值后的样式
// M3D专题图仅支持SimpleFillSymbol符号
symbol: new SimpleFillSymbol({
// 填充颜色
color: new Color(255, 0, 0)
})
},
{
// 最小过滤范围,field对应的值大于等于minValue
minValue: 3,
// 最大过滤范围,field对应的值小于maxValue
maxValue: 5,
// 匹配到该值后的样式
// M3D专题图仅支持SimpleFillSymbol符号
symbol: new SimpleFillSymbol({
// 填充颜色
color: 'rgb(255, 123, 220)'
})
}
]
})
// 构造场景图层
const layer = new IGSSceneLayer({
// 服务基地址
url: '服务基地址',
// 设置场景初始化参数
scenes: [{
// 设置子图层初始化参数
sublayers: [{
// 子图层id
id: 'id',
// 设置专题图渲染器
renderer: renderer,
// 子图层初始化参数
extensionOptions: {
// 开启自动跳转
autoReset: true
}
}]
}]
});
// ES5引入方式
const { IGSSceneLayer } = zondy.layer
// ES6引入方式
import { IGSSceneLayer } from "@mapgis/webclient-common"
// 构造Cesium原生渲染器
const renderer = {
// 专题图过滤字段名
field: "字段名",
// 专题图类型-分段
type: "class-breaks",
// 分段专题图过滤条件数组
classBreakInfos: [{
// 最小过滤范围,field对应的值大于等于minValue
minValue: 1,
// 最大过滤范围,field对应的值小于maxValue
maxValue: 7,
// 渲染符号
symbol: {
// 渲染类型为M3D
type: 'mesh-3d',
// 覆盖物图层
symbolLayers: [{
// 图层类型-颜色填充
type: "fill",
// 图层材质
material: {
// 填充颜色
color: Cesium.Color.ANTIQUEWHITE
}
}]
}
}]
}
// 构造场景图层
const layer = new IGSSceneLayer({
// 服务基地址
url: '服务基地址',
// 设置场景初始化参数
scenes: [{
// 设置子图层初始化参数
sublayers: [{
// 子图层id
id: 'id',
// 子图层初始化参数
extensionOptions: {
// 开启自动跳转
autoReset: true,
// 设置专题图渲染器
renderer: renderer
}
}]
}]
});
// ES5引入方式
const { IGSSceneLayer } = zondy.layer
// ES6引入方式
import { IGSSceneLayer } from "@mapgis/webclient-common"
// 构造Cesium原生渲染器
const renderer = {
// 专题图过滤字段名
field: "字段名",
// 专题图类型-单值
type: "unique-value",
// 单值专题图过滤条件数组
uniqueValueInfos: [
// 指定字段值
value: '过滤字段值',
// 渲染符号
symbol: {
// 渲染类型为M3D
type: 'mesh-3d',
// 覆盖物图层
symbolLayers: [{
// 图层类型-颜色填充
type: "fill",
// 图层材质
material: {
// 填充颜色
color: new Cesium.Color(0.0, 0.0, 1.0, 0.5)
}
}]
}
]
};
// 构造场景图层
const layer = new IGSSceneLayer({
// 服务基地址
url: '服务基地址',
// 设置场景初始化参数
scenes: [{
// 设置子图层初始化参数
sublayers: [{
// 子图层id
id: 'id',
// 子图层初始化参数
extensionOptions: {
// 开启自动跳转
autoReset: true,
// 设置专题图渲染器
renderer: renderer
}
}]
}]
});
Extends
Members
-
activeSceneIGSScene
-
活跃的场景对象
-
allSublayersCollection.<IGSSceneSubLayer> null
-
所有子图层
-
capabilitiesObject
-
图层支持能力。
默认仅 Cesium 引擎支持加载,Leaflet/MapboxGL 等非三维引擎会被标记为
loaded=false。 -
descriptionString
-
描述信息
-
documentInfoObject
-
场景文档信息
-
fieldInfoArray.<String>
-
服务包含的表字段数组
-
positionObject null
-
模型位置
-
sceneIndexString
-
场景id
-
sceneNameString
-
场景名
-
scenesArray.<IGSScene>
-
场景集合
-
spatialReferenceSpatialReference
-
图层坐标系对象
-
typeLayerType
-
图层类型
-
urlString
-
服务基地址
-
versionString
-
服务版本号
Methods
-
_createSublayerOptions(serverSublayerInfo, clientSublayerInfo, extendOptions){*}
document/layer/igserver/IGSSceneLayer.js, line 598 -
创建sublayer
Name Type Description serverSublayerInfo* clientSublayerInfo* extendOptionsObject 扩展参数
Returns:
Type Description * -
_getTypeByOriginLayerType(originLayerType){*}
document/layer/igserver/IGSSceneLayer.js, line 662 -
根据原始图层类型获取子图层类型
Name Type Description originLayerType* Returns:
Type Description * -
clone(){IGSSceneLayer}
document/layer/igserver/IGSSceneLayer.js, line 819 -
克隆图层对象。
Returns:
Type Description IGSSceneLayer 克隆后的 IGSSceneLayer 实例。 -
findSublayerById(id){IGSSceneSubLayer|null}
document/layer/igserver/IGSSceneLayer.js, line 829 -
通过子图层 ID 查询子图层。
Name Type Description idString 子图层 id。
Returns:
Type Description IGSSceneSubLayer | null 查询到的子图层;未找到返回 null。 -
toJSON(){Object}
document/layer/igserver/IGSSceneLayer.js, line 788 -
将图层导出为 JSON 配置。
Returns:
Type Description Object 图层配置对象。 -
IGSSceneLayer.fromJSON(json){IGSSceneLayer}
document/layer/igserver/IGSSceneLayer.js, line 807 -
通过 JSON 配置创建 IGSSceneLayer 实例。
Name Type Description jsonObject 图层配置对象。
Returns:
Type Description IGSSceneLayer 新的 IGSSceneLayer 实例。