TilesetLayer

TilesetLayer

new TilesetLayer(viewer, opt, styleopt)

Example
let tilesetLayer = new TilesetLayer(viewer,{
        url: "http://192.168.21.108:9999/jcjy/jcjy-hb/tileset.json",
        show: true,
        maximumScreenSpaceError: 16,
        maximumMemoryUsage: 1024,
        center: {
            z: 10
        },
        style: {
            color: {
                conditions: [
                    ['${Height} >= 100', 'color("purple", 0.5)'],
                    ['${Height} >= 50', 'color("red")'],
                    ['true', 'color("blue")']
                ]
            },
            show: '${Height} > 0'
        },
        view: {
            "x": 109.7884118470029,
            "y": 39.590384952017764,
            "z": 1565.7899788867958,
            "heading": 331.1978494043747,
            "pitch": -8.45296669256617,
            "roll": 0.00043210090111595544,
            "duration": 0
        }
    });
    tilesetLayer.load();
Parameters:
Name Type Attributes Description
viewer Cesium.Viewer 地图viewer对象
opt Object 基础配置,其余参数同Cesium.Cesium3DTileset
Properties
Name Type Attributes Default Description
url String 模型服务地址
show Boolearn <optional>
true 是否显示
view Object <optional>
模型定位视角
center Object <optional>
设置模型中心点,如果只修改高度,x、y可不设置
position Cesium.Cartesian3 | Object <optional>
模型位置,和center二选一
style Object <optional>
模型样式

Members

type

Properties:
Name Type Description
type String 类型

Methods

destroy()

Description:
  • 销毁模型

hide()

Description:
  • 隐藏模型

setAlpha(alphaopt)

Description:
  • 设置模型透明度
Parameters:
Name Type Attributes Default Description
alpha Number <optional>
1

setCenter(opt)

Description:
  • 设置模型中心点
Parameters:
Name Type Description
opt Object | Cesium.Cartesian3
Properties
Name Type Description
x Number 经度
y Number 纬度
z Number 高度

setVisible()

Description:
  • 显示隐藏

show()

Description:
  • 显示模型

updateStyle(style)

Description:
  • 修改模型样式
Example
style={
        color : {
            conditions : [
                ['${Height} >= 100', 'color("purple", 0.5)'],
                ['${Height} >= 50', 'color("red")'],
                ['true', 'color("blue")']
            ]
        },
        show : '${Height} > 0'
}
Parameters:
Name Type Description
style Object

zoomTo()

Description:
  • 定位至模型