Members
# ConeSensorPrimitive
锥形传感器
Example
new Cesium.Scene.ConeSensorPrimitive(viewer,{
position: Cesium.Cartesian3.fromDegrees(117.224, 31.819, 128),
angle: 80,
radius: 700000,
heading: Cesium.Math.toRadians(0),
pitch: Cesium.Math.toRadians(40),
roll: Cesium.Math.toRadians(0),
color:{
red: 1,
green: 0,
blue: 0,
alpha: 0.4,
},
lineColor {
red: 1,
green: 1,
blue: 1,
alpha: 0.9,
}
})
Methods
# AmapImageryProvider(options) → {UrlTemplateImageryProvider}
高度地图扩展
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
style |
string
|
图层类型,可选['elec'| 'img'] |
url |
string
|
地址 |
subdomains |
boolean
|
子域 |
UrlTemplateImageryProvider
Example
viewer.imageryLayers.addImageryProvider(new Cesium.Scene.AmapImageryProvider({
style: 'img'
}));
# BaiduImageryProvider(options, url, style)
百度影像拓展
Parameters:
Name | Type | Description |
---|---|---|
options |
Object
|
|
url |
string
|
图层路径 |
style |
string
|
样式,可选['normal'|'midnight'|'dark'|'googlelite'|'redalert'] |
Example
const opts = {
url: 'https://api.map.baidu.com/customimage/tile?udt=20181205&scale=1&ak=1XjLLEhZhQNUzd93EjU5nOGQ',
style: 'midnight'
}
viewer.imageryLayers.addImageryProvider(new Cesium.Scene.BaiduImageryProvider(commonOption));
# CircleFadeMaterialProperty(options)
渐变圆材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
Example
const circleFadeMaterial = new Cesium.Scene.CircleFadeMaterialProperty({
color: Cesium.Color.fromCssColorString("#02ff00"),
duration: 2000,
});
# CircleWaveMaterialProperty(options)
波动圆材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
count |
number
|
频率 |
gradient |
number
|
渐进频率 |
Example
const custMaterial = new Cesium.Scene.CircleWaveMaterialProperty({
count: 2,
color: Cesium.Color.BLUE,,
gradient: 0.3,
duration:60
});
# GoogleImageryProvider(options) → {ImageryProvider}
谷歌地图加载方法
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
subdomains |
boolean
|
子域 |
style |
string
|
图层类型,可选['img'|'ter'] |
ImageryProvider
Example
viewer.imageryLayers.addImageryProvider(new Cesium.Scene.GoogleImageryProvider({
style: 'img'
}));
# PolylineCityLinkMaterialProperty(options)
动态泛光线(随机颜色)
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
color |
Color
|
颜色 |
duration |
number
|
持续时长 |
imgUrl |
string
|
图片 |
- See:
Example
import { Graphics } from 'cesium_dev_kit'
const graphicObj = new Graphics({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
const polylineCityLinkMaterial = new Cesium.Scene.PolylineCityLinkMaterialProperty({
color: new Cesium.Color(5.0, 5.0, 10.0),
duration: 2000
});
graphicObj.graphics.getLineGraphics({
positions:Cesium.Cartesian3.fromDegreesArray([
104.09816110606057,
30.659821965447698,
104.1120972824757,
30.65330300319938,
104.10758419863926,
30.64592470850288,
104.09351691196979,
30.652434826507452,
104.09816110606057,
30.659821965447698
]),
material:polylineCityLinkMaterial,
clampToGround:false,
width:1
})
# PolylineFlowMaterialProperty(options)
流动线材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
Example
import { Graphics } from 'cesium_dev_kit'
const graphicObj = new Graphics({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
const polylineMaterial = new Cesium.Scene.PolylineFlowMaterialProperty({
color: new Cesium.Color(77 / 255, 201 / 255, 255 / 255, 1),
duration: 200
})
graphicObj.graphics.getLineGraphics({
positions:Cesium.Cartesian3.fromDegreesArray([
104.09816110606057,
30.659821965447698,
104.1120972824757,
30.65330300319938,
104.10758419863926,
30.64592470850288,
104.09351691196979,
30.652434826507452,
104.09816110606057,
30.659821965447698
]),
material:polylineMaterial,
clampToGround:false,
width:1
})
# PolylineTrailLinkMaterial(options)
多线段尾链
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
duration |
number
|
持续时长 |
speed |
number
|
速度 |
color |
Color
|
颜色 |
image |
string
|
图片 |
Example
import { Graphics } from 'cesium_dev_kit'
const graphicObj = new Graphics({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
// 创建材质
const polylineMaterial = new Cesium.Scene.PolylineTrailLinkMaterial({
color: Cesium.Color.BLUE.withAlpha(0.4),
duration: 15000,
image: 'static/data/images/Textures/river.png',
speed: 0.5
})
graphicObj.graphics.craeteCorridorGraphics({
positions: Cesium.Cartesian3.fromDegreesArray(
110.16018735617934, 31.036076859828338,
110.17845812703679,31.033686527335444,
110.19261040403379, 31.02892781958261,
110.20775152895165,31.02475678594998,
110.2247484728178,31.019315371809977,
110.24033095328579,31.017866033294506),
width: 1500.0,
height: 0,
extrudedHeight: 50,
cornerType: Cesium.CornerType.MITERED,
outline: false,
material:polylineMaterial
})
# ProbingPrimitive(option)
卫星雷达波
Parameters:
Name | Type | Description |
---|---|---|
option |
object
|
|
length |
number
|
长度 |
center |
Cartesian3
|
中心坐标 |
color |
Color
|
颜色 |
repeat |
number
|
重复次数 |
offset |
number
|
偏移 |
thickness |
number
|
厚度 |
bottom |
number
|
底部半径 |
top |
number
|
顶部半径 |
Example
viewer.scene.primitives.add(new Cesium.Scene.ProbingPrimitive({
center: Cesium.Cartesian3.fromDegrees(104.081701757991, 30.627042558105988, 180.0),
color: Cesium.Color.BLUE,
top: 1090.0,
bottom: 257.0,
thickness: 0.8,
offset:0,
repeat:6,
length:348
}));
# ShadowPrimitive(options, options)
阴影图元
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
scene |
Scene
|
scene场景对象 |
options |
Cartesian3
|
相机位置 |
Example
new Cesium.Scene.ShadowPrimitive({
scene: viewer.scene,
viewerPosition:Cesium.Cartesian3.fromDegrees(104.081701757991, 30.627042558105988, 400.0)
});
# SkyBoxOnGround(options)
拓展近景天空盒
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
sources |
object
|
配置天空盒六面的图片 |
show |
boolean
|
是否显示 |
Example
new Cesium.Scene.GroundSkyBox({
sources: {
positiveX: "static/data/images/SkyBox/rightav9.jpg",
negativeX: "static/data/images/SkyBox/leftav9.jpg",
positiveY: "static/data/images/SkyBox/frontav9.jpg",
negativeY: "static/data/images/SkyBox/backav9.jpg",
positiveZ: "static/data/images/SkyBox/topav9.jpg",
negativeZ: "static/data/images/SkyBox/bottomav9.jpg",
},
})
# TdtImageryProvider(options) → {WebMapTileServiceImageryProvider}
天地图加载方法
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
key |
string
|
天地图key |
style |
string
|
图层类型,可选['cva'|'img'|'ter'] |
WebMapTileServiceImageryProvider
Example
viewer.imageryLayers.addImageryProvider(new Cesium.Scene.TdtImageryProvider({
key: '7eb11c0c503429878691ac917238f87f',
style: 'cva'
}));
# TencentImageryProvider(options) → {ImageryProvider}
腾讯底图加载方法
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
layer |
string
|
图层类型,可选['elec'| 'img'] |
url |
string
|
地址 |
subdomains |
boolean
|
子域 |
ImageryProvider
Example
viewer.imageryLayers.addImageryProvider(
new Cesium.Scene.TencentImageryProvider({
layer: 'img',
url: 'https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229'
}));
# TerrainClipPlan(t, i)
地形裁剪
Parameters:
Name | Type | Description |
---|---|---|
t |
viewer
|
viewer |
i |
object
|
|
height |
number
|
高度 |
splitNum |
number
|
裁剪大小 |
wallImg |
string
|
四周贴图 |
bottomImg |
string
|
底部贴图 |
positions |
Cartesian3
|
裁剪位置信息 |
Example
import { Draw } from 'cesium_dev_kit'
const {viewer,draw} = new Draw({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
});
var _height = 30,_splitNum = 50,
_wallImg = "static/data/images/file/excavate_side_min.jpg",
_bottomImg ="static/data/images/file/excavate_bottom_min.jpg";
draw.drawPolygonGraphics({
callback: function (polygon, polygonObj) {
draw._drawLayer.entities.remove(polygonObj);
let terrainClipPlan = new Cesium.Scene.TerrainClipPlan(viewer, {
height: _height,
splitNum: _splitNum,
wallImg: _wallImg,
bottomImg: _bottomImg,
});
const cartesian3Coor = draw.transformWGS84ArrayToCartesianArray(polygon);
terrainClipPlan.updateData(cartesian3Coor);
}
});
# TetrahedronPrimitive(options)
光锥图元
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
position |
Cartesian3
|
坐标 |
distance |
number
|
距离 |
speed |
number
|
速度 |
color |
Color
|
颜色 |
scale |
Cartesian3
|
缩放比例 |
Example
viewer.scene.primitives.add(new Cesium.Scene.TetrahedronPrimitive({
position: Cesium.Cartesian3.fromDegrees(104.081701757991, 30.627042558105988, 180.0),
color: Cesium.Color.BLUE,
distance: 100.0,
speed: 2.0,
scale: new Cesium.Cartesian3(30, 30, 50)
}));
# WarnLinkMaterialProperty(options)
警示标线材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
count |
number
|
频率 |
freely |
string
|
方向,可选["vertical"|"cross"] |
direction |
string
|
方向,可选["-"|"+"] |
Example
const warnLinkMaterial = new Cesium.Scene.WarnLinkMaterialProperty({
freely: "cross",
color: Cesium.Color.YELLOW,
duration: 1000,
count: 1.0,
direction: "+",
})
Type Definitions
Object
# CartographicType
WGS84地理坐标
Properties:
Name | Type | Description |
---|---|---|
longitude |
number
|
经度 |
latitude |
number
|
纬度 |
height |
number
|
高度 |
Object
# WGS84Type
84坐标信息
Properties:
Name | Type | Description |
---|---|---|
lng |
number
|
经度 |
lat |
number
|
纬度 |
alt |
number
|
高度 |
Object
# cameraPosType
相机位置信息
Properties:
Name | Type | Description |
---|---|---|
lon |
number
|
经度 |
lat |
number
|
纬度 |
height |
number
|
高度 |
heading |
number
|
朝向,角度 |
pitch |
number
|
倾斜度,角度 |
roll |
number
|
翻滚角,角度 |
position |
Cartesian3
|
相机笛卡尔积位置 |
cameraHeading |
number
|
相机朝向 |
cameraPitch |
number
|
相机倾斜度 |
cameraRoll |
number
|
相机翻滚角 |
center |
object
|
中心坐标,{x:102.736485445,y:29.87345} |
direction |
Cartesian3
|
方向 |
Object
# clickPositionType
点击后返回位置信息
Properties:
Name | Type | Description |
---|---|---|
wgs84Coor |
WGS84Type
|
点击位置 |
graphicCoor |
CartographicType
|
实体真实位置 |
cameraPosition |
cameraPosType
|
相机位置 |
object
# ctrlManualFlag
模型拖拽标识
Properties:
Name | Type | Description |
---|---|---|
selected |
boolean
|
是否选中 |
leftDown |
boolean
|
左键按下 |
Object
# extraConfigOptions
其它的额外配置
Properties:
Name | Type | Description |
---|---|---|
AccessToken |
string
|
认证token |
logo |
boolean
|
显示logo,默认true |
depthTest |
boolean
|
是否开启深度参数,默认false |
Object
# providerConfOptions
配置provider的参数 json 对象
Properties:
Name | Type | Description |
---|---|---|
type |
string
|
Provider类型,可选WebMapTileServiceImageryProvider/UrlTemplateImageryProvider/TileMapServiceImageryProvider |
options |
Cesium.WebMapTileServiceImageryProvider.ConstructorOptions
|
Cesium.UrlTemplateImageryProvider.ConstructorOptions
|
Cesium.TileMapServiceImageryProvider.ConstructorOptions
|
每一个provider 的参数配置,参考官方的provider |
Object
# queryOptionsType
路线查询参数类型
Properties:
Name | Type | Description |
---|---|---|
url |
string
|
服务地址(可选) |
key |
string
|
查询服务的key(可选) |
origin |
Array.<number>
|
起点坐标 |
destination |
Array.<number>
|
终点坐标 [102.223,92.843] |
avoidpolygons |
Array.<Arra.<number>>
|
避让区域(可选) |
Object
# resModulesType
所有模块实例信息
Properties:
Name | Type | Description |
---|---|---|
viewer |
Viewer
|
cesium 实例 |
graphics |
Graphics
|
图形实例 |
mterial |
Material
|
材质实例 |
primitive |
Primitive
|
图元实例 |
draw |
Draw
|
画笔实例 |
analysis |
Analysis
|
分析实例 |
customCesiumPlugin |
CustomCesiumPlugin
|
自定义扩展(传感器)实例 |
passEffect |
PassEffect
|
后置处理实例 |
plugin |
Plugin
|
插件实例 |
threeJs |
ThreeJs
|
集成threejs实例 |
control |
Control
|
控制模块实例 |
math2d |
Math2d
|
数学2d计算工具实例 |
math3d |
Math3d
|
数学3d计算工具实例 |
attackArrowObj |
AttackArrow
|
标会(攻击箭头)模块 |
straightArrowObj |
StraightArrow
|
标会(直线箭头)模块 |
pincerArrowObj |
PincerArrow
|
标会(钳击箭头)模块 |
Object
# threeObj
three实例对象
Properties:
Name | Type | Description |
---|---|---|
scene |
Scene
|
场景对象 |
renderer |
WebGLRenderer
|
webgl渲染对象 |
camera |
PerspectiveCamera
|
相机对象 |