方法
添加特效圆-动态辐射波
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
color |
String
|
"#80ccff"
|
可选
颜色 |
multiple |
Number
|
1
|
可选
旋转倍数 |
radians |
Number
|
50
|
可选
半径 |
|
添加特效圆锥
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
color |
String
|
"#80ccff"
|
可选
颜色 |
multiple |
Number
|
1
|
可选
倍数 |
radians |
Number
|
500
|
可选
半径 |
length |
Number
|
100
|
可选
圆锥长度 |
|
添加特效圆柱
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
color |
String
|
"#80ccff"
|
可选
颜色 |
multiple |
Number
|
1
|
可选
倍数 |
radians |
Number
|
500
|
可选
半径 |
length |
Number
|
100
|
可选
圆柱长度 |
number |
Number
|
30
|
可选
圆柱的边数,不小于3 |
|
向三维场景中添加热力图。
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称。 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
type |
String
|
'Heatmap'
|
可选
热力图类型[Heatmap/HeatmapGL](可选)。 |
sourceData |
Object
|
|
可选
热力图点数据(可选)。 |
flyTo |
Boolean
|
true
|
可选
加载数据后定位。 |
radius |
Number
|
50
|
可选
半径。 |
alpha |
Number
|
1
|
可选
矩形面透明度。 |
height |
Number
|
|
可选
矩形面高度,未设置高度则贴地。 |
dynamic |
Boolean
|
false
|
可选
动态半径,半径随高度变化而变化,点数多时慎用。 |
minRadius |
Number
|
1
|
可选
最小半径,dynamic为true生效。 |
maxRadius |
Number
|
50
|
可选
最大半径,dynamic为true生效。 |
minOpacity |
Number
|
0.1
|
可选
最小透明度,HeatmapGL无效。 |
maxOpacity |
Number
|
0.8
|
可选
最大透明度,HeatmapGL无效。 |
blur |
Number
|
0.85
|
可选
模糊系数,模糊系数越高,渐变就越平滑,HeatmapGL无效。 |
gradient |
Object
|
{'.3': 'blue','.5': 'green','.7': 'yellow','.95': 'red'}
|
可选
渐变色,HeatmapGL无效。 |
tooltip |
Boolean
|
false
|
可选
是否显示tooltip,HeatmapGL无效。 |
|
返回:
返回一个Heatmap的对象。
加载kml数据
调用方法:
sgworld.Creator.addKmlLayer('kml数据', './demo/kml/facilities/facilities.kml', true);
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
url |
String
|
地址 |
checked |
Boolean
|
是否显示 |
callback |
function
|
回调函数 |
返回:
浏览方式:添加对象
添加特效圆-旋转
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
radius |
Number
|
500
|
可选
半径 |
image |
String
|
|
可选
贴图 |
|
添加四面体
参数描述:
名称 |
类型 |
默认值 |
描述 |
Viewer |
Viewer
|
|
地图视图 |
options |
Object
|
|
参数 |
option.position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
option.scale |
Cartesian3
|
|
可选
比例 |
option.color |
String
|
"#80ccff"
|
可选
颜色 |
option.outlineColor |
String
|
"#ffff00"
|
可选
颜色 |
option.multiple |
Number
|
1
|
可选
倍数 |
option.animate |
Boolean
|
true
|
可选
是否开启动画 |
添加红绿灯
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
name |
String
|
|
可选
名称 |
scale |
Number
|
1
|
可选
比例 |
heading |
Number
|
0
|
可选
方向 |
far |
Number
|
800
|
可选
最远可视 |
position |
Object
|
|
位置
名称 |
类型 |
默认值 |
描述 |
lon |
Number
|
|
经度 |
lat |
Number
|
|
纬度 |
height |
Number
|
0
|
可选
高度 |
|
left |
Object
|
-1
|
可选
左转灯状态,-1:红灯,0:黄灯,1:绿灯 |
center |
Object
|
1
|
可选
直行灯状态,同上 |
right |
Object
|
1
|
可选
右转灯状态,同上 |
time |
Number
|
30
|
可选
等待时间 |
|
向三维场景中视频。
addVideoBox(position, option) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
名称。 |
option |
Object
|
可选
参数。 |
返回:
返回一个Cesium的对象。
向三维场景中视频。
addVideoPolygon(position, option) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
名称。 |
option |
Object
|
可选
参数。 |
返回:
返回一个Cesium的对象。
添加视锥
调用方法:
sgworld.Creator.addViewCone({
position: {
lon: 120,
lat: 29,
height: 110,
},
heading: -90,
pitch: -30,
roll: 0,
near: 10,
far: 160,
fov: 80
});
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数
名称 |
类型 |
描述 |
position |
Degrees
|
可选
相机位置 |
heading |
Number
|
可选
方位角 |
pitch |
Number
|
可选
俯仰角 |
roll |
Number
|
可选
然滚角 |
fov |
Number
|
可选
fov |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
fillColor |
String
|
可选
填充色 |
outlineColor |
String
|
可选
边框色 |
|
返回:
锥形传感器
参数描述:
名称 |
类型 |
描述 |
startPosition |
Cartesian3
|
可选
起点坐标。 |
endPosition |
Cartesian3
|
可选
终点坐标 |
option |
Object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
color |
String
|
rgba(255,0,0,0.5)
|
可选
填充色 |
outline |
Boolean
|
true
|
可选
显示边框 |
outlineColor |
String
|
rgba(255,255,255,0.5)
|
可选
边框色 |
angle |
Number
|
10
|
可选
夹角 |
|
返回:
创建模型
create3DTilesets(name, url, option, style, GroupID, checked, func) → SE3DTileset
调用方法:
model = sgworld.Creator.create3DTilesets('新建模型', './static/model/tileset.json');
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
url |
string
|
可选
模型路径 |
option |
object
|
可选
模型参数(同Cesium3DTileset参数,参考 http://cesium.xin/cesium/Documentation/Cesium3DTileset.html)
名称 |
类型 |
描述 |
id |
String
|
可选
模型id |
Level |
Number
|
可选
模型显示层级 |
height |
Number
|
可选
模型高度,同style.groundHeight |
flyTo |
Boolean
|
可选
是否加载完成后视角跟随 |
time |
object
|
可选
模型存在的时间段
名称 |
类型 |
描述 |
start |
String
|
可选
模型存在的起始时间 |
end |
String
|
可选
模型存在的结束时间 |
|
|
style |
object
|
可选
模型样式
名称 |
类型 |
默认值 |
描述 |
colors |
String
|
"#ffffff"
|
可选
模型颜色 |
removeLighting |
Boolean
|
|
可选
自定义shader移除光照 |
snow |
Boolean
|
false
|
可选
积雪特效 |
snowAlpha |
Number
|
0.8
|
可选
积雪透明度 |
effects |
Boolean
|
false
|
可选
模型特效(常用于建筑白膜特效) |
effectsMaxHeight |
Number
|
150
|
可选
模型特效最大高度(常用于建筑白膜特效) |
groundHeight |
Number
|
|
可选
模型高度(用于模型坐标正确,高度不正确的情况,groundHeight: 100) |
groundCenter |
Array
|
|
可选
模型中心位置(用于模型坐标和高度都不正确的情况,groundCenter: [112, 32, 50]) |
heading |
Number
|
|
可选
z反方向旋转角 |
pitch |
Number
|
|
可选
x反方向旋转角 |
roll |
Number
|
|
可选
y反方向旋转角 |
edit |
Object
|
|
可选
模型编辑参数(用于模型编辑,修改模型经纬度高度、旋转角、比例)
名称 |
类型 |
描述 |
lon |
Number
|
可选
经度 |
lat |
Number
|
可选
纬度 |
height |
Number
|
可选
高度 |
scale |
Number
|
可选
比例 |
heading |
Number
|
可选
方位角 |
pitch |
Number
|
可选
俯仰角 |
roll |
Number
|
可选
翻滚角 |
|
|
GroupID |
string
|
可选
所在组 |
checked |
Boolean
|
可选
是否显示 |
func |
object
|
可选
回调函数 |
返回:
加载ArcGis影像图层
createArcGisImageryLayer(name, option, GroupID, index, checked, disFnc) → ImageryLayer
调用方法:
var dx = {
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
enablePickFeatures: false
};
sgworld.Creator.createArcGisImageryLayer("ARCGIS", dx, "0", undefined, true, "");
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
url |
String
|
|
地址 |
alpha |
Number
|
1
|
可选
透明度 |
Level |
String
|
Number
|
|
可选
显示级别,如18,或"5,18" |
usePreCachedTilesIfAvailable |
Boolean
|
|
可选
是否使用服务的内置的切片方案,偏移纠正需要使用如下自定义的方案 |
tilingScheme |
Cesium.TilingScheme
|
|
可选
切片方式 |
|
GroupID |
String
|
可选
父节点id |
index |
Number
|
可选
影像优先级 |
checked |
Boolean
|
是否勾选 |
disFnc |
function
|
可选
回调函数 |
返回:
返回ImageryLayer对象
创建Arcgis地形
createArcGISTerrain(name, option, GroupID, checked)
调用方法:
var option = {
url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
};
sgworld.Creator.createArcGISTerrain("ArcGIS地形", option, "0", true, "");
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
option |
Object
|
参数
名称 |
类型 |
描述 |
id |
string
|
可选
id |
url |
Boolean
|
服务地址 |
|
GroupID |
string
|
可选
所在组 |
checked |
Boolean
|
可选
是否显示 |
POI 点
渲染效果:
调用方法:
poi = sgworld.Creator.createBillboard({
lon, //经度
lat, //纬度
height: 10, //高度
text: "POI点", //文本内容
textLocation: "right", //文本位置
fontSize: 24, //文本字体大小
fontColor: "#99ff66", //字体颜色
fontOffset: { //文本自定义偏移量
"x": 0,
"y": 0,
},
image: "https://www.terra-it.cn/images/tubiao/indexLogo.png", //POI图标地址
data: { //自定义属性列表,用于回调返回
"custom_a": "a", //自定义属性A
"custom_b": "b" //自定义属性B
}
})
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数
名称 |
类型 |
描述 |
id |
String
|
可选
唯一id |
lon |
number
|
经度 |
lat |
number
|
纬度 |
height |
number
|
高度 |
image |
string
|
可选
显示图片的链接地址 |
scale |
number
|
可选
图片缩放,默认 1 |
distanceDisplayCondition |
Object
|
可选
可显示距离 |
visibility |
boolean
|
可选
创建时是否显示,默认是 |
|
返回:
Billboard对象,Billboard继承MapObject
这个方法用于创建图片标签
参数描述:
名称 |
类型 |
描述 |
objs |
Array
|
可选
一个经纬度数组 例如:[{image:"tup.img",log:-114.0,lat: 40.0, height:300000.0}]。 |
返回:
返回一个Cesium的对象。
创建circleGeofeaturelayer
createBillboardGeoJsonFeature(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
image: "",// Property optional A Property specifying the Image, URI, or Canvas to use for the billboard.
show: true,// optional A boolean Property specifying the visibility of the billboard.
scale: 1.0,//optional A numeric Property specifying the scale to apply to the image size.
horizontalOrigin: this._cesium.HorizontalOrigin.CENTER,// optional A Property specifying the HorizontalOrigin.
verticalOrigin: this._cesium.VerticalOrigin.CENTER,// optional A Property specifying the VerticalOrigin.
eyeOffset: this._cesium.Cartesian3.ZERO,// optional A Cartesian3 Property specifying the eye offset.
pixelOffset: this._cesium.Cartesian2.ZERO,// optional A Cartesian2 Property specifying the pixel offset.
rotation: 0,// optional A numeric Property specifying the rotation about the alignedAxis.
alignedAxis: this._cesium.Cartesian3.ZERO,// optional A Cartesian3 Property specifying the unit vector axis of rotation.
width: undefined,// optional A numeric Property specifying the width of the billboard in pixels, overriding the native size.
height: undefined,// optional A numeric Property specifying the height of the billboard in pixels, overriding the native size.
color: this._cesium.Color.WHITE,// optional A Property specifying the tint Color of the image.
heightReference: this._cesium.HeightReference.NONE,// optional A Property specifying what the height is relative to.
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
这个方法用于创建长方体
createBox(position, box, name, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组 例如:[-114.0, 40.0, 300000.0]。 |
box |
object
|
可选
对象。对象{
dimensions: new this._cesium.Cartesian3(400000.0, 300000.0, 500000.0),
material: this._cesium.Color.RED.withAlpha(0.5),
fill: false,
outline: true,
outlineColor: this._cesium.Color.BLACK
} |
name |
String
|
可选
圆的文字。 |
GroupID |
String
|
可选
组。 |
返回:
返回一个Cesium的对象。
仿照te修改
这个方法用于创建长方体
CreateBox(Position, ObjectWidth, ObjectDepth, ObjectHeight, LineColor, FillColor, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向。 |
ObjectWidth |
number
|
可选
长方体的宽度(单位:米)。 |
ObjectDepth |
number
|
可选
长方体的深度(单位:米)。 |
ObjectHeight |
number
|
可选
长方体的高度(单位:米)。 |
LineColor |
String
|
可选
组成长方体的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
长方体的填充色。颜色值由RGB定义。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中长方体的名称。 |
返回:
返回一个Cesium的对象。
创建Cesium在线全球地形
createCesiumTerrain(name, option, GroupID, checked)
调用方法:
sgworld.Creator.createCesiumTerrain("Cesium全球地形", {}, "0", true);
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
option |
Object
|
可选
参数
名称 |
类型 |
描述 |
id |
string
|
可选
id |
requestVertexNormals |
Boolean
|
可选
是否请求顶点法线 |
|
GroupID |
string
|
可选
所在组 |
checked |
Boolean
|
可选
是否显示 |
这个方法用于创建圆
createCircle(position, CircleStyle, name, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组例如:[-114.0, 40.0, 300000.0]。 |
CircleStyle |
object
|
可选
对象。对象{
semiMinorAxis: 300000.0,
semiMajorAxis: 300000.0,
height: 200000.0,
material: this._cesium.Color.GREEN,
outline: true,
} |
name |
String
|
可选
圆的文字。 |
GroupID |
String
|
可选
组 |
返回:
返回一个Cesium的对象。
仿照te修改
这个方法用于创建圆
CreateCircle(Position, Radius, LineColor, FillColor, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向 |
Radius |
number
|
可选
对象的半径(单位:米)。 |
LineColor |
String
|
可选
组成圆的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
圆的填充色。颜色值由RGB定义。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中圆的名称。 |
返回:
返回一个Cesium的对象。
向三维场景中添加圆(优化可编辑)。
createCircleOptimization(name, position, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String
|
Int
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
创建circleGeofeaturelayer
createCirclePointGeoJsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
radius:1,
height: 0,
heightReference: this._cesium.HeightReference.NONE,
extrudedHeight: 0,
extrudedHeightReference: this._cesium.HeightReference.NONE,
show: true,
fill: true,
material: this._cesium.Color.WHITE,
outline: false,
outlineColor: this._cesium.Color.BLACK,
outlineWidth: 1,
near: 0,
far: 5000
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
创建circleGeofeaturelayer
createCirclePointGeoJsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
radius:1,
height: 0,
heightReference: this._cesium.HeightReference.NONE,
extrudedHeight: 0,
extrudedHeightReference: this._cesium.HeightReference.NONE,
show: true,
fill: true,
material: this._cesium.Color.WHITE,
outline: false,
outlineColor: this._cesium.Color.BLACK,
outlineWidth: 1,
near: 0,
far: 5000
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
创建云图
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
area |
object
|
区域范围 |
CloudMap |
array
|
云图, 云图影像数组 |
speed |
double
|
速度 |
这个方法用于创建颜色
createColor(red, green, blue, alphae) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
red |
number
|
可选
红色组件。 |
green |
number
|
可选
绿色组件。 |
blue |
number
|
可选
蓝色组件。 |
alphae |
number
|
可选
alphea组件。 |
返回:
返回一个Cesium的颜色对象。
仿照te修改
这个方法用于创建颜色
createColor(red, green, blue, alpha) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
red |
number
|
可选
红。 |
green |
number
|
可选
绿。 |
blue |
number
|
可选
蓝。 |
alpha |
number
|
可选
透明度。 |
返回:
返回一个Cesium的颜色对象。
这个方法用于创建圆锥
createCone(position, cylinder, name) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组。 |
cylinder |
object
|
可选
对象。对象{
length: 400000.0,
topRadius: 0.0,
bottomRadius: 200000.0,
material: this._cesium.Color.GREEN
} |
name |
String
|
可选
圆锥显示的文字。 |
返回:
返回一个Cesium的对象。
仿照te修改
这个方法用于创建圆锥
CreateCone(Position, Radius, ObjectHeight, LineColor, FillColor, NumOfSegments, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向。 |
Radius |
number
|
可选
圆锥体的半径。 |
ObjectHeight |
number
|
可选
圆锥体的高度。 |
LineColor |
String
|
可选
组成圆锥体的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
圆锥的填充色。颜色值由RGB定义。 |
NumOfSegments |
number
|
可选
组成圆锥体的部分数目。部分数据越多,圆锥体越圆滑。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中圆锥的名称。 |
返回:
返回一个Cesium的对象。
这个方法用于创建雷达
createConeRadar(position, cylinder, name, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组。 |
cylinder |
object
|
可选
对象。对象{
length: 400000.0,
topRadius: 0.0,
bottomRadius: 200000.0,
material: this._cesium.Color.GREEN
} |
name |
String
|
可选
圆锥显示的文字。 |
GroupID |
String
|
可选
圆锥显示的文字。 |
返回:
返回一个Cesium的对象。
创建走廊
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
仿照te修改
这个方法用于创建圆柱
CreateCylinder(Position, Radius, ObjectHeight, LineColor, FillColor, NumOfSegments, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向。 |
Radius |
number
|
可选
圆柱体的半径。 |
ObjectHeight |
number
|
可选
圆柱体的高度。 |
LineColor |
String
|
可选
组成圆柱体的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
圆柱的填充色。颜色值由RGB定义。 |
NumOfSegments |
number
|
可选
组成圆柱体的部分数目。部分数据越多,圆柱体越圆滑。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中圆柱名称。 |
返回:
返回一个Cesium的对象。
向三维场景中添加圆柱(优化可编辑)。
createCylinderOptimization(name, position, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String
|
Int
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
向三维场景中添加一个div点。
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称。 |
degrees |
Object
|
可选
经纬度 |
option |
Object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
GroupID |
String
|
|
可选
GroupID |
type |
String
|
"default"
|
可选
类型【default | custom】 |
offset |
String
|
Array
|
"l"
|
可选
对齐方式【左: l | 中: c | 右: r | [左|中|右, 20]】 |
description |
String
|
|
可选
内容 |
near |
Number
|
0
|
可选
最小可视距离 |
far |
Number
|
Infinity
|
可选
最大可视距离 |
onclick |
function
|
|
可选
点击事件 |
update |
function
|
|
可选
更新事件 |
|
返回:
返回DivPoint对象
浏览方式:开始浏览
仿照te修改
这个方法用于创建椭圆
CreateEllipse(Position, RadiusX, RadiusY, LineColor, FillColor, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向 |
RadiusX |
number
|
可选
椭圆沿X轴半径。 |
RadiusY |
number
|
可选
椭圆沿Y轴半径。 |
LineColor |
String
|
可选
组成椭圆的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
椭圆的填充色。颜色值由RGB定义。
* @param {number} [NumOfSegments] 组成圆锥体的部分数目。部分数据越多,圆锥体越圆滑。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中椭圆的名称。 |
返回:
返回一个Cesium的对象。
流场
调用方法:
sgworld.Creator.createField({
type: "ocean",
upath: SmartEarthRootUrl + "Workers/field/data/MIT.0000000001_UVEL_1.dat",
vpath: SmartEarthRootUrl + "Workers/field/data/MIT.0000000001_VVEL_1.dat",
}, function () { });
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
参数{
名称 |
类型 |
描述 |
type |
String
|
类型【ocean】 |
upath |
String
|
文件路径 |
vpath |
String
|
文件路径 |
|
callback |
function
|
可选
回调函数 |
返回:
返回一个CanvasField的对象。
向三维场景中添加垂直飞线。
参数描述:
名称 |
类型 |
描述 |
positions |
Array
|
可选
飞线点。 |
option |
Object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
time |
Number
|
3000
|
可选
时间 |
width |
Number
|
1
|
可选
线宽 |
alpha |
Number
|
0
|
可选
透明度 |
color |
String
|
'#ffffff'
|
可选
颜色 |
|
返回:
返回一个TrailLine对象。
创建geofeaturelayer
createGeoJsonDataSource(name, geojsonOrurl, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
Creator.createGeoJsonFeatureLayer(name,geojsonOrurl,option,GroupID,disFnc) 创建geofeaturelayer
createGeoJsonFeatureLayer(name, geojsonOrurl, option, GroupID, disFnc) → item:layer
调用方法:
{object} 参数说明
name: this._viewer.camera.position.clone(),
geojsonOrurl: 0,
option: {
"layertype": "", //图层类型
"text": "", //显示的文本
"font": "16px", //字体
"fillColor": this._cesium.ALICEBLUE,//字体填充颜色
"outlineColor": this._cesium.BLACK, //边框颜色
"outlineWidth": "1.0", //边框宽度
"scale": "1.0", //缩放
"maxDistanceDisplay": 55555555, //最大可视化距离
"minDistanceDisplay": 5000, //最小可视化距离
"icon": "" //显示的图标
},
GroupID: 0,
disFnc:function(){}
参数描述:
名称 |
类型 |
描述 |
name |
String
|
|
geojsonOrurl |
String
|
|
option |
object
|
|
GroupID |
object
|
|
disFnc |
object
|
|
返回:
结果:
Throws:
- Version:
- 3.1.0
创建geofeaturelayer
创建
Creator.createGeoJsonFeatureLayerProviderClassOptimization(name,geoOptions,styleOption,GroupID,checked,disFnc) 矢量切片拉伸面面数据加载
createGeoJsonFeatureLayerProviderClassOptimization(name, geoOptions, styleOption, GroupID, checked, disFnc) → CloudMap
调用方法:
{object} 参数说明
name:名称
geoOptions:{
url:'请求地址'
layer:'图层'
upperLevelLimit:'最大请求高度'
lowerLevelLimit:'最小请求高度'
}
option: {
show: true, // optional A boolean Property specifying the visibility of the volume.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the line strip.
shape: undefined, // optional A Property specifying the array of Cartesian2 positions which define the shape to be extruded.
cornerType: this._cesium.CornerType.ROUNDED, // optional A CornerType Property specifying the style of the corners.
granularity: this._cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the volume is filled with the provided material.
material: this._cesium.Color.WHITE, //optional ,//A Property specifying the material used to fill the volume.
outline: false, //optional A boolean Property specifying whether the volume is outlined.
outlineColor: this._cesium.Color.BLACK, //optional A Property specifying the Color of the outline.
outlineWidth: 1.0, //optional A numeric Property specifying the width of the outline.
shadows: this._cesium.ShadowMode.DISABLED, // optional An enum Property specifying whether the volume casts or receives shadows from each light source.
level_max: 20,
level_min: 10,
}
GroupID:''
checked:true
disFnc:function(){}
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
geoOptions |
object
|
geo参数配置 |
styleOption |
object
|
样式参数配置 |
GroupID |
string
|
组编号 |
checked |
bool
|
是否显示 |
disFnc |
object
|
function(){} |
返回:
结果:
Throws:
- Version:
Creator.createGeoJsonFeatureLayerProviderGisOptimization(name,geoOptions,styleOption,GroupID,checked,disFnc) 矢量切片贴地面面数据加载
createGeoJsonFeatureLayerProviderGisOptimization(name, geoOptions, styleOption, GroupID, checked, disFnc) → item:layer
调用方法:
{object} 参数说明
name:名称
geoOptions:{
url:'请求地址'
layer:'图层'
upperLevelLimit:'最大请求高度'
lowerLevelLimit:'最小请求高度'
}
option: {
show: true, // optional A boolean Property specifying the visibility of the volume.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the line strip.
shape: undefined, // optional A Property specifying the array of Cartesian2 positions which define the shape to be extruded.
cornerType: this._cesium.CornerType.ROUNDED, // optional A CornerType Property specifying the style of the corners.
granularity: this._cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the volume is filled with the provided material.
material: this._cesium.Color.WHITE, //optional ,//A Property specifying the material used to fill the volume.
outline: false, //optional A boolean Property specifying whether the volume is outlined.
outlineColor: this._cesium.Color.BLACK, //optional A Property specifying the Color of the outline.
outlineWidth: 1.0, //optional A numeric Property specifying the width of the outline.
shadows: this._cesium.ShadowMode.DISABLED, // optional An enum Property specifying whether the volume casts or receives shadows from each light source.
level_max: 20,
level_min: 10,
}
GroupID:''
checked:true
disFnc:function(){}
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
geoOptions |
object
|
geo参数配置 |
styleOption |
object
|
样式参数配置 |
GroupID |
string
|
组编号 |
checked |
bool
|
是否显示 |
disFnc |
object
|
function(){} |
返回:
结果:
Throws:
- Version:
矢量切片-面
createGeoJsonFeatureLayerProviderOptimization(name, geoOptions, styleOption, GroupID, checked, disFnc) → VectorGeoJsonFeatureLayer
调用方法:
let urls = {
url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts',
layer: 'cite:fangwu1',
srs: 'EPSG:4326',
upperLevelLimit: 13,
lowerLevelLimit: 22,
};
let de = {
level_min: urls.upperLevelLimit,
level_max: urls.lowerLevelLimit,
material: '#00ffff',
height: 0,
extrudedHeight: 50,
near: 0,
far: Infinity,
};
let layer = sgworld.Creator.createGeoJsonFeatureLayerProviderOptimization(
'矢量切片-面',
urls,
de,
"0",
true,
function () {
sgworld.Navigate.flyToObj(layer)
}
);
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
geoOptions |
Object
|
数据参数
名称 |
类型 |
描述 |
url |
String
|
服务地址 |
layer |
String
|
图层名 |
srs |
String
|
可选
坐标系 |
upperLevelLimit |
Number
|
可选
最大显示层级 |
lowerLevelLimit |
Number
|
可选
最小显示层级 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
level_min |
Number
|
可选
最小显示层级 |
level_max |
Number
|
可选
最大显示层级 |
material |
String
|
可选
填充色 |
extrudedHeight |
Number
|
可选
拉伸高度 |
height |
Number
|
可选
高度 |
clampToGround |
Boolean
|
可选
是否贴地 |
classificationType |
Cesium.ClassificationType
|
可选
贴地类型 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
|
GroupID |
String
|
|
checked |
Boolean
|
|
disFnc |
function
|
|
返回:
创建鹰眼
调用方法:
sgworld.Creator.createHawkeye(
{
url: SmartEarthRootUrl + "Workers/image/earth.jpg"
}
);
参数描述:
名称 |
类型 |
描述 |
options |
string
|
鹰眼图层参数
名称 |
类型 |
描述 |
url |
string
|
可选
鹰眼图层单张图片地址 |
imageryProvider |
string
|
可选
鹰眼影像图层 |
|
style |
object
|
可选
鹰眼区域参数
名称 |
类型 |
描述 |
width |
String
|
可选
鹰眼区域宽度 |
height |
String
|
可选
鹰眼区域高度 |
top |
String
|
可选
鹰眼区域top |
bottom |
String
|
可选
鹰眼区域bottom |
left |
String
|
可选
鹰眼区域left |
right |
String
|
可选
鹰眼区域right |
|
矢量切片柱状图
createHistogramVectorGeoJsonFeatureLayer(name, geoOptions, styleOption, GroupID, checked, disFnc)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
图层名 |
geoOptions |
Object
|
图层参数
名称 |
类型 |
默认值 |
描述 |
url |
String
|
|
服务地址 |
layer |
String
|
|
服务图层 |
srs |
String
|
'EPSG:4490'
|
可选
坐标系 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
radius |
Number
|
50
|
可选
柱状图半径 |
scale |
Number
|
1
|
可选
柱状图高度倍数 |
alpha |
Number
|
0.5
|
可选
底部面透明度 |
defaultColor |
String
|
#ffffff
|
可选
默认颜色 |
color |
String
|
Array
|
#ffffff
|
可选
柱状图颜色配置 |
height |
Number
|
String
|
100
|
可选
柱状图高度 |
showLabel |
Boolean
|
true
|
可选
显示文本 |
value |
function
|
|
可选
文本内容,默认为高度值,function(value, prop){} |
label |
Cesium.LabelGraphics
|
|
可选
文本样式
名称 |
类型 |
描述 |
useColorConfig |
Boolean
|
可选
使用柱状图颜色配置 |
|
level_min |
Number
|
|
可选
最小显示层级 |
level_max |
Number
|
|
可选
最大显示层级 |
|
GroupID |
String
|
工程树父节点id |
checked |
Boolean
|
是否显示 |
disFnc |
function
|
回调函数 |
这个方法用于创建图像标签
createImageLabel(position, ImageLabel, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组 例如:[-114.0, 40.0, 300000.0]。 |
ImageLabel |
object
|
可选
对象。对象{
image: '../images/Cesium_Logo_overlay.png',
show: true, // default
color: this._cesium.Color.IVORY,
} |
GroupID |
double
|
可选
组的ID,高程数据图层在该组中被创建。如果GroupID设置为零,则对象在根节点下创建。你可以通过以下方法获得GroupID。 |
Description |
double
|
可选
标签名字。 |
返回:
返回一个Cesium的对象。
仿照te
全球格网
调用方法:
sgworld.Creator.createImageryLayerGrid();
参数描述:
名称 |
类型 |
描述 |
option |
Cesium.GridImageryProvider.ConstructorOptions
|
可选
参数 |
返回:
加载影像图层
createImageryProvider(name, type, option, GroupID, index, checked, disFnc) → ImageryLayer
调用方法:
sgworld.Creator.createImageryProvider("百度", "BaiduMap", {}, "0", undefined, true, "");
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
type |
String
|
类型【arcgis|geoserver|wms|cesiumBlack|tms|skymap|goglemap|BingMap|OpenStreetMap|MapBox|BaiduMap】 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
url |
String
|
|
可选
地址 |
alpha |
Number
|
1
|
可选
透明度 |
Level |
String
|
Number
|
|
可选
显示级别,如18,或"5,18"" |
|
GroupID |
String
|
可选
父节点id |
index |
Number
|
可选
影像优先级 |
checked |
Boolean
|
是否勾选 |
disFnc |
function
|
可选
回调函数 |
返回:
返回ImageryLayer对象
Creator.createLabel(position,text,labelStyle,GroupID,Description) 创建label标签
createLabel(position, text, labelStyle, GroupID, Description) → label
调用方法:
{object} 参数说明
position:[]
text:'text'
labelStyle:{
id: '', //获取或设置拾取标签时返回的用户定义值。
text: Texts, //文本
backgroundColor: LabelStyle.BackgroundColor, //获取或设置此标签的背景色。
font: LabelStyle.FontName,
horizontalOrigin: this._cesium.HorizontalOrigin.CENTER,
verticalOrigin: this._cesium.VerticalOrigin.CENTER,
show: true,
scale: LabelStyle.Scale,
showBackground: false,
distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(LabelStyle.MinViewingHeight, LabelStyle.MaxViewingHeight)
}
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
一个经纬度数组[x,y]。 |
text |
String
|
文本。 |
labelStyle |
Object
|
文本样式 |
GroupID |
String
|
组编号 |
Description |
String
|
描述 |
返回:
结果:
Throws:
- Version:
仿照te
矢量切片-文本点
createLabelImageGeoJsonFeatureLayerProvider(name, geoOptions, styleOption, GroupID, checked, disFnc) → LabelGeoJsonFeatureLayercopy
调用方法:
let urls = {
url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts',
layer: 'sf:archsites',
srs: 'EPSG:4326',
upperLevelLimit: 11,
lowerLevelLimit: 22,
};
let de = {
level_min: urls.upperLevelLimit,
level_max: urls.lowerLevelLimit,
fillColor: "#00ffff",
outlineColor: "#000000",
heightReference:0,
pointHeight: undefined,
showBackground: false,
outlineWidth: 2,
text: "[str1]",
font_size: "18px",
font_family: "微软雅黑",
disableDepthTestDistance: Infinity,
near: 0,
far: 1000000,
};
let layer = sgworld.Creator.createLabelImageGeoJsonFeatureLayerProvider(
'矢量切片-点',
urls,
de,
"0",
true,
function () {
sgworld.Navigate.flyToObj(layer)
}
);
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
geoOptions |
Object
|
数据参数
名称 |
类型 |
描述 |
url |
String
|
服务地址 |
layer |
String
|
图层名 |
srs |
String
|
可选
坐标系 |
upperLevelLimit |
Number
|
可选
最大显示层级 |
lowerLevelLimit |
Number
|
可选
最小显示层级 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
level_min |
Number
|
可选
最小显示层级 |
level_max |
Number
|
可选
最大显示层级 |
text |
String
|
可选
文本内容 |
image |
String
|
可选
图标地址 |
fillColor |
String
|
可选
文本填充色 |
color |
String
|
可选
图标颜色 |
outlineColor |
String
|
可选
文本边框色 |
backgroundColor |
String
|
可选
文本背景色 |
font_size |
Number
|
可选
文本大小 |
font_family |
String
|
可选
字体 |
heightReference |
Number
|
可选
高度类型 |
pointHeight |
Number
|
可选
高度 |
outlineWidth |
Number
|
可选
文本边框宽度 |
bold |
Boolean
|
可选
加粗 |
italic |
Boolean
|
可选
斜体 |
showBackground |
Boolean
|
可选
显示背景 |
|
option.disableDepthTestDistance |
Number
|
可选
禁用深度检测距离,为Infinity则无视遮挡 |
option.labelData |
Cesium.LabelGraphics.ConstructorOptions
|
可选
文本扩展参数 |
option.imageData |
Cesium.BillbaordGraphics.ConstructorOptions
|
可选
图标扩展参数 |
styleOption.near |
Number
|
可选
最小可视距离 |
styleOption.far |
Number
|
可选
最大可视距离 |
GroupID |
String
|
|
checked |
Boolean
|
|
disFnc |
function
|
|
返回:
创建geojson文本点数据
createLabelPointGeoJsonFeatureLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
调用方法:
var urls = "http://183.162.245.49:8099/geoserver/POI/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=POI:shenghui84&outputFormat=application%2Fjson";
var data = {
font_family: "微软雅黑",
font_size: 16,
horizontalOrigin: 0,
verticalOrigin: -1,
layertype: "labellayer",
near: 0,
far: 8000000,
pointHeight: 60000,
showBackground: false,
text: "[name]",
};
var dx = sgworld.Creator.createLabelPointGeoJsonFeatureLayer("", urls, data, "0", true, function (data) {
sgworld.Navigate.flyToObj(data);
});
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
text |
String
|
可选
文本内容 |
image |
String
|
可选
图标地址 |
color |
String
|
可选
图标颜色 |
fillColor |
String
|
可选
填充色 |
outlineColor |
String
|
可选
边框色 |
backgroundColor |
String
|
可选
背景色 |
font_size |
Number
|
可选
文本大小 |
font_family |
String
|
可选
字体 |
bold |
Boolean
|
可选
加粗 |
italic |
Boolean
|
可选
斜体 |
showBackground |
Boolean
|
可选
显示文本背景 |
outlineWidth |
Number
|
可选
文本边框大小 |
pointHeight |
Number
|
String
|
可选
点高度 |
heightReference |
Number
|
可选
高度类型 |
disableDepthTestDistance |
Number
|
可选
禁用深度检测距离,为Infinity则无视遮挡 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
labelData |
Cesium.LabelGraphics.ConstructorOptions
|
可选
文本扩展参数 |
imageData |
Cesium.BillbaordGraphics.ConstructorOptions
|
可选
图标扩展参数 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
可选
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
创建落地线。
参数描述:
名称 |
类型 |
描述 |
position |
Object
|
可选
位置。 |
option |
Object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
width |
Number
|
2
|
可选
宽度 |
color |
String
|
#ffffff
|
可选
颜色 |
|
返回:
矢量切片分层设色
createLaycolorVectorGeoJsonFeatureLayer(name, geoOptions, styleOption, GroupID, checked, disFnc)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
图层名 |
geoOptions |
Object
|
图层参数 |
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
默认值 |
描述 |
type |
Number
|
"2D"
|
可选
分层设色类型【2D | 3D】 |
height |
Number
|
String
|
100
|
可选
拉伸高度,仅在3D有效 |
scale |
Number
|
1
|
可选
拉伸高度倍数 |
alpha |
Number
|
0.5
|
可选
面透明度 |
defaultColor |
String
|
#ffffff
|
可选
默认颜色 |
color |
String
|
Array
|
#ffffff
|
可选
颜色配置 |
|
GroupID |
String
|
工程树父节点id |
checked |
Boolean
|
是否显示 |
disFnc |
function
|
回调函数 |
向三维场景中添加链路。
参数描述:
名称 |
类型 |
描述 |
position1 |
Array
|
可选
点1。 |
position2 |
Array
|
可选
点2。 |
options |
Object
|
可选
参数。{
lineType: 1, //线形(可选)
num: 200, //线段采样数(可选)
width: 2, //线宽(可选)
speed: 1, //倍速(可选)
lineColor: 'rgba(255,255,255,0.5)', //线颜色(可选)
pointColor: 'rgba(255,255,255,0.5)', //点填充颜色(可选)
outlineColor: 'rgba(255,255,255,0.5)', //点边框线颜色(可选)
outlineWidth: 2, //点边框宽度(可选)
size: 8, //点大小(可选)
} |
返回:
返回一个Polyline的对象。
添加链路(优化版)。
调用方法:
var position11 = { lon: 117.18004164267542, lat: 31.833828547032773, height: 1000 };
var position12 = { lon: 117.17010804888875, lat: 31.85456077387976, height: 10 };
var options1 = {
width: 4, //线宽(可选)
// time: 3000, //时间(可选)
lineColor: '#0000ff', //线颜色(可选)
// pointColor: '#ffffff', //点填充颜色(可选)
}
let link1 = sgworld.Creator.createLinkPro(position11, position12, options1);
参数描述:
名称 |
类型 |
描述 |
position1 |
Array
|
Cartesian3
|
Degrees
|
可选
点1。 |
position2 |
Array
|
Cartesian3
|
Degrees
|
可选
点2。 |
options |
Object
|
可选
参数
名称 |
类型 |
描述 |
width |
Number
|
可选
线宽 |
time |
Number
|
可选
倍速 |
lineColor |
String
|
可选
线颜色 |
pointColor |
String
|
可选
点填充颜色 |
clampToGround |
Boolean
|
可选
是否贴地 |
|
返回:
返回一个Polyline的对象。
向三维场景中添加链路(优化版)。
createLinkPros(position1, position2, options) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
position1 |
Array
|
可选
点1。 |
position2 |
Array
|
可选
点2。 |
options |
Object
|
可选
参数。 |
返回:
返回一个Cesium的对象。
Creator.createLocation(name,position,GroupID) 向三维场景中添加一个兴趣点
调用方法:
{object} 参数说明
name
position
GroupID
参数描述:
名称 |
类型 |
描述 |
x |
String
|
|
y |
String
|
|
z |
String
|
|
返回:
结果:
Throws:
- Version:
Creator.createLonlat(method) 获取点击点坐标
调用方法:
{object} 参数说明
function ({
lng: lng,
lat: lat,
height: height
}){}
参数描述:
返回:
结果:
Throws:
- Version:
创建测量弹框
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
向三维场景中添加一个模型。
createModel(Position, FileName, Option, GroupID, Description, callback) → PointModel
调用方法:
var url = SmartEarthRootUrl + "Workers/Model/weixin.gltf";
var position = [120, 32, 10000];
var ent = {
heading: -40,
pitch: 0,
roll: 0,
scale: 10,
};
var tiltModel = sgworld.Creator.createModel(position, url, ent, '0', "GLTF模型", function (data) {
sgworld.Navigate.flyToObj(data);
});
参数描述:
名称 |
类型 |
描述 |
Position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
FileName |
String
|
可选
想要加载模型的完整路径名或URL。 |
Option |
Object
|
可选
模型参数。
名称 |
类型 |
描述 |
id |
String
|
可选
id |
rotate |
Boolean
|
可选
自旋转 |
heading |
Number
|
可选
方向角 |
pitch |
Number
|
可选
俯仰角 |
roll |
Number
|
可选
翻滚角 |
|
GroupID |
String
|
可选
组的ID,模型在该组中被创建。如果GroupID设置为零,则对象在根节点下创建。 |
Description |
String
|
可选
显示在信息树中模型的名称。 |
callback |
function
|
可选
回调函数。 |
返回:
返回一个PointModel的对象。
模型裁剪
参数描述:
名称 |
类型 |
描述 |
tileset |
Cesium3DTileset
|
3DTileset |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
positions |
Array
|
|
坐标 |
type |
String
|
|
裁剪类型【polygon】 |
isInner |
Boolean
|
false
|
可选
是否内裁剪 |
|
返回:
创建模型(标绘模型)
createModelEditable(Position, FileName, Option, GroupID, Description, callback) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
FileName |
String
|
可选
想要加载模型的完整路径名或URL。 |
Option |
Object
|
可选
模型参数。 |
GroupID |
String
|
可选
组的ID,模型在该组中被创建。如果GroupID设置为零,则对象在根节点下创建。 |
Description |
String
|
可选
显示在信息树中模型的名称。 |
callback |
function
|
可选
回调函数。 |
返回:
返回一个Cesium的对象。
创建geojson模型点数据
createModelGeojsonFeatureLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
调用方法:
var urls = "http://183.162.245.49:8099/geoserver/sdkp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sdkp:JTSS&outputFormat=application%2Fjson";
var data = {
url:"http://183.162.245.49:8099/ModelLibrary/电力设备/tower.glb",
far: 2000,
near: 0,
height: 1,
};
var dx = sgworld.Creator.createModelGeojsonFeatureLayer("", urls, data, "0", true, function (data) {
// sgworld.Navigate.flyToObj(data);
});
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
url |
String
|
可选
模型地址 |
color |
String
|
可选
颜色 |
scale |
Number
|
可选
比例 |
height |
Number
|
String
|
可选
高度 |
heading |
Number
|
可选
方向角 |
pitch |
Number
|
可选
俯仰角 |
roll |
Number
|
可选
翻滚角 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
可选
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
矢量切片-模型点
调用方法:
let urls = {
url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts',
layer: 'sdkp:JTSS',
srs: 'EPSG:4326',
upperLevelLimit: 16,
lowerLevelLimit: 22,
};
let de = {
level_min: urls.upperLevelLimit,
level_max: urls.lowerLevelLimit,
uri: "http://183.162.245.49:8099/ModelLibrary/电力设备/tower.glb",
color: "#ffffff",
scale: 1,
heightReference: 0,
height: 0,
near: 0,
far: 2000,
};
let layer = sgworld.Creator.createModelGeoJsonFeatureLayerProvider(
'矢量切片-模型点',
urls,
de,
"0",
true,
function () {
sgworld.Navigate.flyToObj(layer);
}
);
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
geoOptions |
Object
|
数据参数
名称 |
类型 |
描述 |
url |
String
|
服务地址 |
layer |
String
|
图层名 |
srs |
String
|
可选
坐标系 |
upperLevelLimit |
Number
|
可选
最大显示层级 |
lowerLevelLimit |
Number
|
可选
最小显示层级 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
level_min |
Number
|
可选
最小显示层级 |
level_max |
Number
|
可选
最大显示层级 |
uri |
String
|
可选
模型地址 |
color |
String
|
可选
颜色 |
scale |
Number
|
可选
模型比例 |
height |
String
|
可选
高度 |
heading |
Number
|
可选
方向角 |
pitch |
Number
|
可选
俯仰角 |
roll |
Number
|
可选
翻滚角 |
|
GroupID |
String
|
|
checked |
Boolean
|
|
disFnc |
function
|
|
返回:
创建模型库弹窗
调用方法:
sgworld.Creator.createModelLibrary()
参数描述:
名称 |
类型 |
描述 |
options |
object
|
可选
弹窗宽度
名称 |
类型 |
描述 |
width |
Number
|
String
|
可选
弹窗宽度 |
height |
Number
|
String
|
可选
弹窗高度 |
offset |
String
|
可选
弹窗位置 |
fn |
Object
|
可选
弹窗响应函数
名称 |
类型 |
描述 |
cancel |
function
|
可选
弹窗关闭函数 |
success |
function
|
可选
弹窗初始化成功函数 |
end |
function
|
可选
弹窗销毁函数 |
|
|
模型压平(遍历所有模型)
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
创建circleGeofeaturelayer
createModelPointGeoJsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
uri: "glb/gltf",
show: true,// optional A boolean Property specifying the visibility of the model.
scale: 1.0, //optional A numeric Property specifying a uniform linear scale.
minimumPixelSize: 0.0,// optional A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
incrementallyLoadTextures: true,//optional Determine if textures may continue to stream in after the model is loaded.
runAnimations: true,// optional A boolean Property specifying if glTF animations specified in the model should be started.
clampAnimations: true,// optional A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
shadows: this._cesium.ShadowMode.ENABLED,// optional An enum Property specifying whether the model casts or receives shadows from each light source.
heightReference: this._cesium.HeightReference.NONE,// optional A Property specifying what the height is relative to.
color: this._cesium.Color.WHITE,// optional A Property specifying the Color that blends with the model's rendered color.
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
模型压平
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
向三维场景中添加流光线图层。
调用方法:
layer = sgworld.Creator.createPathLayer({
url: 'line.json',
lineColor: "#0033FF", //线的颜色
lineAlpha: 1.0, //线的透明度
linewidth: 4.0, //线的宽度
pointColor: "#FFFFFF", //移动点的颜色
speed: 1
});
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id(可选)。 |
url |
String
|
|
可选
geojson路径。 |
color |
String
|
"#0033FF"
|
可选
线颜色。 |
alpha |
Number
|
1.0
|
可选
线透明度。 |
width |
Number
|
5.0
|
可选
线宽。 |
pointColor |
String
|
"#FFFFFF"
|
可选
点颜色。 |
pointColor |
Number
|
1.0
|
可选
点透明度。 |
speed |
Number
|
1
|
可选
点移动速度。 |
near |
Number
|
0
|
可选
最小可视距离。 |
far |
Number
|
Math.MAX_VALUE
|
可选
最大可视距离。 |
|
返回:
返回一个TrailLine对象。
创建标绘弹框
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
创建label标签
createPoint(name, position, fillColor, GroupID, option, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
文本 |
position |
Array
|
可选
一个经纬度数组[x,y,z]。 |
fillColor |
String
|
可选
颜色 #fff |
GroupID |
String
|
可选
所在组编号 |
option |
Object
|
可选
参数 |
Description |
String
|
可选
描述 |
返回:
返回一个Cesium的对象。
创建geojson点数据
createPointGeojsonFeatureLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
调用方法:
var urls = "http://183.162.245.49:8099/geoserver/POI/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=POI:shenghui84&outputFormat=application%2Fjson";
var data = {
far: 90000,
color: "#f00",
outlineColor: "#ff0",
near: 0,
outlineWidth: 2,
pixelSize: 10,
pointHeight: 50000
};
var dx = sgworld.Creator.createPointGeojsonFeatureLayer("", urls, data, "0", true, function (data) {
sgworld.Navigate.flyToObj(data);
});
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
color |
String
|
可选
填充色 |
outlineColor |
String
|
可选
边框色 |
pixelSize |
Number
|
可选
大小 |
outlineWidth |
Number
|
可选
边框大小 |
pointHeight |
Number
|
String
|
可选
点高度 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
可选
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
创建点模型
createPointModel(parameter, function) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
parameter |
object
|
可选
参数对象。 |
function |
methond
|
可选
回调函数 |
返回:
返回一个Cesium的对象。
向三维场景中添加对象点(优化可编辑)。
createPointOptimization(name, position, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String
|
Int
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
向三维场景中添加对象点(优化)。
createPointOptimization(name, position, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String
|
Int
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
向三维场景中添加面。
createPolygon(Geometry, LineColor) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Geometry |
Array
|
可选
一个经纬度数组 例如:[{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204},{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204}]。 |
LineColor |
String
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
点击编辑
创建PolygonGeoJsonFeatureLayer
createPolygonGeoJsonFeatureLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
geojsonOrurl |
String
|
geojson地址 |
option |
Object
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
material |
String
|
"#ffffff"
|
可选
填充色 |
outlineColor |
String
|
"#000000"
|
可选
边框色 |
fillColor |
String
|
"#ffffff"
|
可选
文本填充色 |
labelOutlineColor |
String
|
"#000000"
|
可选
文本边框色 |
height |
Number
|
|
可选
高度 |
extrudedHeight |
Number
|
|
可选
拉伸高度 |
classificationType |
Cesium.ClassificationType
|
|
可选
贴地类型 |
clampToGround |
Boolean
|
|
可选
是否贴地 |
outline |
Boolean
|
|
可选
是否显示边框 |
outlineWidth |
Number
|
|
可选
边框宽度 |
water |
Boolean
|
|
可选
是否水面 |
mask |
Boolean
|
|
可选
是否反选遮罩 |
bulidingWall |
Boolean
|
|
可选
是否建筑边界 |
bulidingWallWidth |
Number
|
|
可选
建筑边界宽度 |
text |
String
|
|
可选
注记内容 |
font |
String
|
|
可选
注记字体 |
font_size |
String
|
|
可选
注记大小 |
italic |
Boolean
|
|
可选
斜体 |
bold |
Boolean
|
|
可选
加粗 |
pixelOffset |
Cartesian2
|
|
可选
文本偏移 |
labelNear |
Number
|
|
可选
注记最小可视距离 |
labelFar |
Number
|
|
可选
注记最大可视距离 |
disableDepthTestDistance |
Number
|
|
可选
注记禁用深度检测距离 |
near |
Number
|
|
可选
最小可视距离 |
far |
Number
|
|
可选
最大可视距离 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
xp修改
createPolygonMapGeoJsonFeatureLayer(disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
向三维场景中添加线。
createPolyline(Geometry, LineColor) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Geometry |
Array
|
可选
一个经纬度数组 例如:[{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204},{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204}]。 |
LineColor |
String
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
仿照te
创建geojson线数据
createPolylineGeoJsonFeatureLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
调用方法:
var urls = "http://183.162.245.49:8099/geoserver/sdkdemo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sdkdemo:shengjie&outputFormat=application%2Fjson";
var data = {
arcType: 0,
material: '#00f',
clampToGround: true,
far: 50000000,
near: 0,
opacity: "1",
width: 3,
};
var dx = sgworld.Creator.createPolylineGeoJsonFeatureLayer("", urls, data, "0", true, function (data) {
sgworld.Navigate.flyToObj(data);
});
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
material |
String
|
可选
填充色 |
outlineColor |
String
|
可选
边框色 |
outlineWidth |
Number
|
可选
边框宽度 |
height |
Number
|
String
|
可选
高度 |
width |
Number
|
可选
宽度 |
clampToGround |
Boolean
|
可选
是否贴地 |
classificationType |
Cesium.ClassificationType
|
可选
贴地类型 |
dash |
Boolean
|
可选
是否虚线 |
dashLength |
Number
|
可选
虚线间隔 |
gapColor |
Number
|
可选
间隔颜色 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
可选
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
创建circleGeofeaturelayer
createpolylineVolumeGeojsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
show: true, // optional A boolean Property specifying the visibility of the volume.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the line strip.
shape: undefined, // optional A Property specifying the array of Cartesian2 positions which define the shape to be extruded.
cornerType: this._cesium.CornerType.ROUNDED, // optional A CornerType Property specifying the style of the corners.
granularity: this._cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the volume is filled with the provided material.
material: this._cesium.Color.WHITE, //optional ,//A Property specifying the material used to fill the volume.
outline: false, //optional A boolean Property specifying whether the volume is outlined.
outlineColor: this._cesium.Color.BLACK, //optional A Property specifying the Color of the outline.
outlineWidth: 1.0, //optional A numeric Property specifying the width of the outline.
shadows: this._cesium.ShadowMode.DISABLED, // optional An enum Property specifying whether the volume casts or receives shadows from each light source.
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
创建管线
createpolylineVolumeGeojsonPrimitiveLayer(name, geojsonOrurl, option, GroupID, checked, disFnc) → GeoJsonFeatureLayer
调用方法:
let url = "http://183.162.245.49:82/sdkdemo_2022/demo/json/js.json";
let de = {
material: '#ff0000',
radius: 0.5,
height: 1,
near: 0,
far: 1000,
radiusScale: 1,
slttype: 0,
connect: true
}
let layer = sgworld.Creator.createpolylineVolumeGeojsonPrimitiveLayer("管线", url, de, "0", true, function (data) {
});
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
material |
String
|
|
可选
填充色 |
radius |
String
|
Number
|
|
可选
管径 |
orth_width |
Number
|
|
可选
方管宽度,slttype为2有效 |
orth_height |
Number
|
|
可选
方管高度,slttype为2有效 |
number |
Number
|
|
可选
星形管边数,slttype为1有效 |
exradius |
Number
|
|
可选
星形管外径,slttype为1有效 |
inradius |
Number
|
|
可选
星形管内径,slttype为1有效 |
slttype |
Number
|
|
管线类型【0:圆管,1:星形管,2:方管】 |
radiusScale |
Number
|
1
|
可选
管径缩放比例 |
height |
Number
|
String
|
Object
|
|
可选
管线高度 |
connect |
Boolean
|
|
可选
是否添加管线接头 |
near |
Number
|
|
可选
最小可视 |
far |
Number
|
|
可选
最大可视 |
|
GroupID |
String
|
可选
父节点id |
checked |
Boolean
|
可选
是否显示 |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个GeoJsonFeatureLayer对象。
创建弹框
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
名称 |
创建entity属性弹窗
createMeasurement
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
options |
object
|
可选
参数。{
width:宽度
height:高度
type:类型(GroundPolygon/ExtrudedPolygon)
fn:回调函数对象。{
cancel:关闭
success:成功
end:销毁
}
} |
Creator.createPosition(x,y,z) 创建position
调用方法:
{object} 参数说明
x
y
z
参数描述:
名称 |
类型 |
描述 |
x |
String
|
|
y |
String
|
|
z |
String
|
|
返回:
结果:
Throws:
- Version:
仿照te修改
这个方法用于创建Position对象
CreatePosition(X, Y, Altitude, AltitudeType, Yaw, Pitch, Roll, Distance) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
X |
number
|
可选
兴趣点的东西方向坐标。 |
Y |
number
|
可选
兴趣点的南北方向坐标。 |
Altitude |
number
|
可选
兴趣点的高程。 |
AltitudeType |
number
|
可选
一个枚举值,定义了了高程类型。 |
Yaw |
number
|
可选
视点和兴趣点的偏移角度。 |
Pitch |
number
|
可选
视点和兴趣点的俯仰角度。 |
Roll |
number
|
可选
视点和兴趣点的翻滚角度。 |
Distance |
number
|
可选
距离点坐标(X,Y,height)的距离,点必须在视线范围内。 |
返回:
返回一个Position对象。
矢量切片-线
createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(name, geoOptions, styleOption, GroupID, checked, disFnc) → PolylineGeoJsonFeatureLayer
调用方法:
let urls = {
url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts',
layer: 'sf:roads',
srs: 'EPSG:4326',
upperLevelLimit: 10,
lowerLevelLimit: 22,
};
let de = {
level_min: urls.upperLevelLimit,
level_max: urls.lowerLevelLimit,
material: '#ffff0030',
outlineColor: '#ff000050',
outlineWidth: 2,
height: undefined,
width: 5,
clampToGround: true,
near: 0,
far: 1000000,
};
let layer = sgworld.Creator.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(
'矢量切片-线',
urls,
de,
"0",
true,
function () {
sgworld.Navigate.flyToObj(layer)
}
);
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
geoOptions |
Object
|
数据参数
名称 |
类型 |
描述 |
url |
String
|
服务地址 |
layer |
String
|
图层名 |
srs |
String
|
可选
坐标系 |
upperLevelLimit |
Number
|
可选
最大显示层级 |
lowerLevelLimit |
Number
|
可选
最小显示层级 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
描述 |
id |
String
|
可选
id |
level_min |
Number
|
可选
最小显示层级 |
level_max |
Number
|
可选
最大显示层级 |
material |
String
|
可选
填充色 |
outlineColor |
String
|
可选
边框色 |
outlineWidth |
Number
|
可选
边框宽度 |
height |
Number
|
可选
高度 |
width |
Number
|
可选
宽度 |
clampToGround |
Boolean
|
可选
是否贴地 |
classificationType |
Cesium.ClassificationType
|
可选
贴地类型 |
dash |
Boolean
|
可选
是否虚线 |
dashLength |
Number
|
可选
虚线间隔 |
gapColor |
Number
|
可选
间隔颜色 |
near |
Number
|
可选
最小可视 |
far |
Number
|
可选
最大可视 |
|
GroupID |
String
|
|
checked |
Boolean
|
|
disFnc |
function
|
|
返回:
创建circleGeofeaturelayer
createPrimitivLabelPointGeoJsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
Name: "",
text: "",
font_size: '30px',
font_family:'sans-serif'
stylet: this._cesium.LabelStyle.FILL,
fillColor: this._cesium.Color.WHITE,// optional A Property specifying the fill Color.
outlineColor: this._cesium.Color.BLACK,// optional A Property specifying the outline Color.
outlineWidth: 1.0,// optional A numeric Property specifying the outline width.
show: true,// optional A boolean Property specifying the visibility of the label.
showBackground: false,// optional A boolean Property specifying the visibility of the background behind the label.
backgroundColor: new this._cesiumColor(0.165, 0.165, 0.165, 0.8),//optional A Property specifying the background Color.
backgroundPadding: new Cartesian2(7, 5),//optional A Cartesian2 Property specifying the horizontal and vertical background padding in pixels.
scale: 1.0,//optional A numeric Property specifying the scale to apply to the text.
horizontalOrigin: this._cesiumHorizontalOrigin.CENTER, //optional A Property specifying the HorizontalOrigin.
verticalOrigin: this._cesium.VerticalOrigin.CENTER,// optional A Property specifying the VerticalOrigin.
eyeOffset: this._cesium.Cartesian3.ZERO,// optional A Cartesian3 Property specifying the eye offset.
pixelOffset: this._cesium.Cartesian2.ZERO,// optional A Cartesian2 Property specifying the pixel offset.
heightReference: this._cesium.HeightReference.NONE,// optional A Property specifying what the height is relative to.
near: 0,
far: 5000
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
雷达视角(自定义)
createRadarMask(name, position, option, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
雷达显示的文字。 |
position |
Array
|
可选
一个经纬度数组。 |
option |
object
|
可选
雷达参数。对象{
radius: 100, //半径
yaw: 0, //雷达方向(可选)
angle: 60, //雷达夹角(可选)
scanAngle: 15, //扫描夹角(可选)
speed: 1, //倍速(可选)
maxLat: 105, //下维度(可选)
minLat: 75, //上维度(可选)
stackPartitions: 64, //横向网格数(可选)
slicePartitions: 64, //纵向网格数(可选)
color: 'rgba(255,255,255,0.5)', //雷达遮罩颜色(可选)
outlineColor: 'rgba(255,255,255,0.5)', //雷达遮罩边框线颜色(可选)
scanColor: 'rgba(255,0,0,0.5)', //扫描颜色(可选)
} |
GroupID |
String
|
可选
GroupID。 |
返回:
返回一个Cesium的对象。
雷达遮罩动态扫描(自定义)
createRadarMaskScan(name, position, option, GroupID) → Cone
调用方法:
//雷达遮罩扫描(自定义)
var option = {
radius: 100, //半径
// yaw: 0, //雷达方向(可选)
angle: 120, //雷达夹角(可选)
scanAngle: 30, //扫描夹角(可选)
speed: 5, //倍速(可选)
maxLat: 90, //下维度(可选)
minLat: 45, //上维度(可选)
stackPartitions: 40, //横向网格数(可选)
slicePartitions: 80, //纵向网格数(可选)
//color: 'rgba(255,255,255,0.5)', //雷达遮罩颜色(可选)
//outlineColor: 'rgba(255,255,255,0.5)', //雷达遮罩边框线颜色(可选)
//scanColor: 'rgba(255,0,0,0.5)', //扫描颜色(可选)
};
var position1 = [114, 30, 0];
// 雷达模型
let Radar1 = sgworld.Creator.addSimpleGraphic('model', {
url: "http://183.162.245.49:8099/ModelLibrary/太空/leida.glb",
scale: 0.1,
position: new Cesium.Cartesian3.fromDegrees(...position1),
removeEdit: true // 屏蔽全局标绘编辑功能
});
// 雷达遮罩
sgworld.Creator.createRadarMaskScan('雷达遮罩扫描1', position1, option)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
Entity
|
可选
一个经纬度数组或entity对象。 |
option |
Object
|
可选
雷达参数。
名称 |
类型 |
默认值 |
描述 |
radius |
Number
|
100
|
可选
半径 |
yaw |
Number
|
0
|
可选
雷达方向 |
angle |
Number
|
60
|
可选
雷达夹角 |
scanAngle |
Number
|
15
|
可选
扫描夹角 |
speed |
Number
|
1
|
可选
倍速 |
maxLat |
Number
|
105
|
可选
下维度 |
minLat |
Number
|
75
|
可选
上维度 |
stackPartitions |
Number
|
30
|
可选
横向网格数 |
slicePartitions |
Number
|
30
|
可选
纵向网格数 |
color |
String
|
'rgba(255,255,255,0.5)'
|
可选
雷达遮罩颜色 |
outlineColor |
String
|
'rgba(255,255,255,0.5)'
|
可选
雷达遮罩边框线颜色 |
scanColor |
String
|
'rgba(255,0,0,0.5)'
|
可选
扫描颜色 |
trackedEntity |
Entity
|
|
可选
跟踪目标对象 |
|
GroupID |
String
|
可选
GroupID。 |
返回:
向三维场景中添加矩形。
CreateRectangle(name, position, option, GroupID, method) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
位置 |
option |
Object
|
可选
矩形参数 |
GroupID |
String
|
可选
GroupID |
method |
function
|
可选
回调函数 |
返回:
返回一个Cesium的对象。
向三维场景中添加矩形(优化可编辑)。
createRectangleOptimization(name, position, GroupID) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
名称 |
position |
Array
|
可选
一个经纬度数组 例如:[x, y, z]。 |
GroupID |
String
|
Int
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
雷达遮罩动态扫描(半球)
createRectangularSensor(position, cylinder, name, GroupID) → Cone
调用方法:
var cylinder = {
radius: 100, //半径
angle: 30, //扫描角度(可选)
speed: 5, //倍速(可选)
stackPartitions: 80, //横向网格数(可选)
slicePartitions: 80, //纵向网格数(可选)
//color: 'rgba(255,255,255,0.5)', //球颜色(可选)
//outlineColor: 'rgba(255,255,255,0.5)', //球边框线颜色(可选)
wallColor: 'rgba(255,255,255,0)', //扫描墙颜色(可选)
//wallOutlineColor: 'rgba(255,0,0,0.5)', //扫描墙颜色(可选)
//surfaceColor: 'rgba(255,0,0,0.5)', //扫描夹角颜色(可选)
};
var item = sgworld.Creator.createRectangularSensor(position, cylinder);
参数描述:
名称 |
类型 |
描述 |
position |
Array
|
可选
一个经纬度数组。 |
cylinder |
object
|
可选
参数
名称 |
类型 |
描述 |
radius |
Number
|
可选
半径 |
angle |
Number
|
可选
扫描角度 |
speed |
Number
|
可选
倍速 |
stackPartitions |
Number
|
可选
横向网格数 |
slicePartitions |
Number
|
可选
纵向网格数 |
color |
String
|
可选
球颜色 |
outlineColor |
String
|
可选
球边框线颜色 |
wallColor |
String
|
可选
扫描墙颜色 |
wallOutlineColor |
String
|
可选
扫描墙边框颜色 |
surfaceColor |
String
|
可选
扫描夹角颜色 |
|
name |
String
|
可选
名称 |
GroupID |
String
|
可选
父节点id |
返回:
返回一个Cone的对象。
添加一个富文本点。
调用方法:
var RichTextPoint = sgworld.Creator.createRichTextPoint('泰瑞天际', [120, 30.004], {
fontColor: '#ffff00',
fontSize: 18
}, '0');
参数描述:
名称 |
类型 |
描述 |
Content |
String
|
可选
内容。 |
position |
Array
|
Object
|
可选
一个经纬度数组或对象 例如:[112, 32, 50]或{x:112,y:32,z:50}。 |
option |
Object
|
Cesium.BillboardGraphics.ConstructorOptions
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
url |
String
|
|
可选
背景图。 |
GroupID |
String
|
'0'
|
可选
GroupID。 |
fontColor |
String
|
'#fff'
|
可选
字体颜色。 |
fontSize |
Number
|
15
|
可选
字体大小。 |
near |
Number
|
0
|
可选
最小可视距离。 |
far |
Number
|
Number.MAX_VALUE
|
可选
最大可视距离。 |
far |
Number
|
Number.MAX_VALUE
|
可选
最大可视距离。 |
data |
Object
|
|
可选
自定义参数 |
|
返回:
返回一个Point的对象。
向三维场景中添加道路
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id(可选)。 |
positions |
Array
|
|
道路点 |
image |
String
|
|
可选
贴图。 |
alpha |
Number
|
1.0
|
可选
透明度。 |
width |
Number
|
20
|
可选
道路宽。 |
height |
Number
|
1
|
可选
道路高。 |
|
返回:
返回一个Road对象。
创建s3m图层
调用方法:
sgworld.Creator.createS3MLayer('http://183.162.245.49:82/05sdkdemo/src/static/models/CBD/cbd.scp', Viewer.scene, function () {
Viewer.scene.camera.setView({
destination: {x: -2182983.9789026394, y: 4386475.285542532, z: 4070311.046889113},
orientation: {
heading: 6.000275912071479,
pitch: -0.4733274387494868
}
});
})
参数描述:
名称 |
类型 |
默认值 |
描述 |
url |
String
|
|
模型地址 |
option |
Object
|
Cesium.Scene
|
|
参数或cesium场景对象 |
options.name |
String
|
|
可选
模型名称 |
options.url |
String
|
|
模型地址 |
options.scene |
Cesium.Scene
|
|
地图场景对象 |
options.near |
Number
|
0
|
可选
最小可视距离 |
options.far |
Number
|
Number.MAX_VALUE
|
可选
最大可视距离 |
options.lodRangeScale |
Number
|
1
|
可选
LOD层级切换距离缩放系数 |
func |
function
|
|
回调函数 |
返回:
创建卫星轨迹
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数。{
start: new Cesium.JulianDate(), //起始时间(可选)
stop: new Cesium.JulianDate(), //结束时间(可选)
speed: 2, //倍速(可选)
path: [], //路径数据(可选)
radarColor: "#00ff00", //雷达颜色(可选)
height: 700000, //卫星高度(可选)
width: 5, //轨迹宽度(可选)
model: 'a.gltf', //卫星模型(可选)
img:'a.png', //卫星图标(可选)
scale: 1, //卫星比例
} |
向三维场景中添加扇形。
createSector(posion, radius) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
posion |
Array
|
可选
一个经纬度数组 例如:[{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204},{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204}]。 |
radius |
int
|
可选
半径。 |
返回:
返回一个Cesium的对象。
仿照te修改
这个方法用于创建球
CreateSphere(Position, Radius, Style, LineColor, FillColor, SegmentDensity, GroupID, Description) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Position |
Object
|
可选
Position表示地面对象的位置和方向。 |
Radius |
number
|
可选
球的半径。 |
Style |
number
|
可选
一个枚举值,定义了球的哪个部分是可见的。 |
LineColor |
String
|
可选
组成球的线的颜色。颜色值由RGB定义。 |
FillColor |
String
|
可选
球的填充色。颜色值由RGB定义。 |
SegmentDensity |
number
|
可选
定义组成球的格网密度。密度值范围1-10,缺省值为4。 |
GroupID |
String
|
可选
组。 |
Description |
String
|
可选
显示在信息树中球名称。 |
返回:
返回一个Cesium的对象。
创建地形(.terrain)
createTerrain(name, option, GroupID, checked, Description)
调用方法:
var option = {
requestVertexNormals: true,
url: "http://183.162.245.49:3301/gisserver/ctsserver/srtm_cts"
};
sgworld.Creator.createTerrain("gisserver地形", option, "0", true, "");
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
option |
Object
|
路径
名称 |
类型 |
描述 |
id |
string
|
可选
id |
url |
string
|
地址 |
requestVertexNormals |
Boolean
|
可选
是否请求顶点法线 |
|
GroupID |
string
|
可选
所在组 |
checked |
Boolean
|
可选
是否显示 |
Description |
string
|
可选
描述 |
创建地形
createTerrainLayer(name, url, option, GroupID, Description)
参数描述:
名称 |
类型 |
描述 |
name |
string
|
可选
名称 |
url |
string
|
可选
路径 |
option |
string
|
可选
地址 |
GroupID |
string
|
可选
所在组 |
Description |
string
|
可选
描述 |
地形压平
createTerrainModifier(name, polygon, altitude)
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
polygon |
Array
|
压平面坐标串 |
altitude |
Number
|
压平高度 |
向三维场景中添加流动线。
调用方法:
let _TrailLine = sgworld.Creator.createTrailLine(
entity.polyline.positions.getValue(),
{
//time: 3000, //时间(可选)
width: 5, //线宽(可选)
color: "#0000ff", //线颜色(可选)
clampToGround: true, //是否贴地(可选)
}
);
参数描述:
名称 |
类型 |
描述 |
Geometry |
Array.<(Cartesian3|Degrees|Array)>
|
可选
坐标。 |
timeOrOption |
Number
|
可选
持续时间或参数
名称 |
类型 |
描述 |
time |
Number
|
可选
持续时间 |
width |
Number
|
可选
宽度 |
color |
String
|
可选
颜色 |
url |
String
|
可选
渐变图片链接 |
clampToGround |
Boolean
|
可选
是否贴地 |
|
返回:
返回一个TrailLinePrimitive的对象。
向三维场景中添加流动路径。
参数描述:
名称 |
类型 |
默认值 |
描述 |
center |
Object
|
|
可选
中心。 |
positions |
Array
|
|
可选
周围点。 |
timeOrOption |
Number
|
Object
|
3000
|
可选
持续时间或参数
名称 |
类型 |
默认值 |
描述 |
time |
Number
|
3000
|
可选
持续时间 |
width |
Number
|
1
|
可选
线宽 |
height |
Number
|
50000
|
可选
抛物线高度 |
num |
Number
|
100
|
可选
线采样数 |
alpha |
Number
|
0.3
|
可选
线透明度 |
far |
Number
|
Infinity
|
可选
最远可视距离 |
inflow |
Boolean
|
false
|
可选
是否为流入效果 |
LightSpot |
Boolean
|
false
|
可选
是否使用光点效果 |
LightSpotColor |
String
|
#ff0000
|
可选
光点颜色,LightSpot为true时生效 |
color |
String
|
#ff0000
|
可选
线颜色 |
url |
String
|
|
可选
渐变图片链接 |
twoColor |
Object
|
|
可选
是否使用双颜色进度条
名称 |
类型 |
默认值 |
描述 |
color1 |
String
|
#00ff00
|
可选
颜色1 |
color2 |
String
|
#ff0000
|
可选
颜色2 |
|
static |
Boolean
|
false
|
可选
是否禁止 |
|
返回:
返回一个TrailLine对象。
添加流动墙。
调用方法:
let _TrailLine = sgworld.Creator.createTrailLineWall(
entity.polyline.positions.getValue(),
{
maximumHeights: [5,5,5,5,5],
minimumHeights: [0,0,0,0,0],
color: "#0000ff", //线颜色(可选)
}
);
参数描述:
名称 |
类型 |
描述 |
Geometry |
Array
|
可选
坐标。 |
timeOrOption |
Number
|
可选
持续时间或参数
名称 |
类型 |
描述 |
time |
Number
|
可选
持续时间 |
maximumHeights |
Number
|
可选
最大高度 |
minimumHeights |
Number
|
可选
最小高度 |
color |
String
|
可选
颜色 |
url |
String
|
可选
渐变图片链接 |
|
返回:
返回一个TrailLinePrimitive的对象。
向三维场景中添加流动墙图层。
调用方法:
layer = sgworld.Creator.createTrailWallLayer({
url: 'wall.json',
color: "#0033FF", //颜色
speed: 1
});
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id(可选)。 |
url |
String
|
|
可选
geojson路径。 |
color |
String
|
"#0000ff"
|
可选
颜色。 |
height |
Number
|
50
|
可选
墙高。 |
minHeight |
Number
|
|
可选
底部高度。 |
near |
Number
|
0
|
可选
最小可视距离。 |
far |
Number
|
Math.MAX_VALUE
|
可选
最大可视距离。 |
speed |
Number
|
1
|
可选
流动速度。 |
|
返回:
返回一个TrailLine对象。
创建指定的URL模板的影像图层
createUrlTemplateImageryProvider(name, option, GroupID, index, checked, disFnc) → ImageryLayer
调用方法:
var urls = "http://183.162.245.49:3301/gisserver/tmsserver/earth_tms"
layer = sgworld.Creator.createUrlTemplateImageryProvider('tms服务', {
url: urls + "/{z}/{x}/{reverseY}.jpeg",
}, '0', undefined, true, "");
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
option |
Object
|
Cesium.UrlTemplateImageryProvider.ConstructorOptions
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
url |
String
|
|
地址 |
alpha |
Number
|
1
|
可选
透明度 |
tilingScheme |
Cesium.TilingScheme
|
|
可选
切片方式 |
Level |
String
|
Number
|
|
可选
显示级别,如18,或"5,18"" |
|
GroupID |
String
|
可选
|
index |
Number
|
可选
影像优先级 |
checked |
Boolean
|
是否勾选 |
disFnc |
function
|
可选
回调函数 |
返回:
返回ImageryLayer对象
矢量切片3dtiles模型
createVector3DTilesFeatureLayer(name, geoOptions, styleOption, GroupID, checked, disFnc)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
图层名 |
geoOptions |
Object
|
可选
图层参数
名称 |
类型 |
默认值 |
描述 |
url |
String
|
|
地址模板 |
_x |
Number
|
0
|
可选
x偏移量 |
_y |
Number
|
0
|
可选
y偏移量 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
默认值 |
描述 |
color |
String
|
#ffffff
|
可选
颜色 |
level_max |
Number
|
20
|
可选
最大显示级别 |
level_min |
Number
|
10
|
可选
最小显示级别 |
tilingScheme |
Cesium.TilingScheme
|
Cesium.WebMercatorTilingScheme
|
可选
切片方式 |
|
GroupID |
String
|
工程树父节点id |
checked |
Boolean
|
是否显示 |
disFnc |
function
|
回调函数 |
xp修改不释放模型
createVector3DTilesFeatureLayerRelease(name, geoOptions, styleOption, GroupID, checked, disFnc)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
图层名 |
geoOptions |
Object
|
可选
图层参数
名称 |
类型 |
默认值 |
描述 |
url |
String
|
|
地址模板 |
_x |
Number
|
0
|
可选
x偏移量 |
_y |
Number
|
0
|
可选
y偏移量 |
|
styleOption |
Object
|
可选
样式参数
名称 |
类型 |
默认值 |
描述 |
color |
String
|
#ffffff
|
可选
颜色 |
level_max |
Number
|
20
|
可选
最大显示级别 |
level_min |
Number
|
10
|
可选
最小显示级别 |
tilingScheme |
Cesium.TilingScheme
|
Cesium.WebMercatorTilingScheme
|
可选
切片方式 |
|
GroupID |
String
|
工程树父节点id |
checked |
Boolean
|
是否显示 |
disFnc |
function
|
回调函数 |
CreateVectorImageFeatureLayer(name, options, queryOptions, GroupID, checked, disFnc)
参数描述:
名称 |
类型 |
描述 |
name |
String
|
|
options |
Object
|
|
queryOptions |
Object
|
|
GroupID |
String
|
|
checked |
Boolean
|
|
disFnc |
function
|
|
创建视锥
调用方法:
sgworld.Creator.createViewCone();
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数
名称 |
类型 |
默认值 |
描述 |
roll |
Number
|
0
|
可选
翻滚角 |
fov |
Number
|
60
|
可选
fov |
near |
Number
|
1
|
可选
最小可视 |
height |
Number
|
1.6
|
可选
视角相对高度 |
fillColor |
String
|
'rgba(0,255,0,0.1)'
|
可选
填充色 |
outlineColor |
String
|
'rgba(0,255,0,1)'
|
可选
边框色 |
|
callBack |
function
|
可选
回调 |
返回:
创建VolumeGeoJsonFeatureLayer
createVolumeGeoJsonFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
show: true, // optional A boolean Property specifying the visibility of the volume.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the line strip.
shape: undefined, // optional A Property specifying the array of Cartesian2 positions which define the shape to be extruded.
cornerType: this._cesium.CornerType.ROUNDED, // optional A CornerType Property specifying the style of the corners.
granularity: this._cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the volume is filled with the provided material.
material: this._cesium.Color.WHITE, //optional ,//A Property specifying the material used to fill the volume.
outline: false, //optional A boolean Property specifying whether the volume is outlined.
outlineColor: this._cesium.Color.BLACK, //optional A Property specifying the Color of the outline.
outlineWidth: 1.0, //optional A numeric Property specifying the width of the outline.
shadows: this._cesium.ShadowMode.DISABLED, // optional An enum Property specifying whether the volume casts or receives shadows from each light source.
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
体积方量测量工具
Creator.createVolumeVectorGeoJsonFeatureLayerDthOptimization(name,geoOptions,styleOption,GroupID,checked,disFnc) 矢量切片单体化面数据加载
createVolumeVectorGeoJsonFeatureLayerDthOptimization(name, geoOptions, styleOption, GroupID, checked, disFnc) → item:layer
调用方法:
{object} 参数说明
name:名称
geoOptions:{
url:'请求地址'
layer:'图层'
upperLevelLimit:'最大请求高度'
lowerLevelLimit:'最小请求高度'
}
option: {
show: true, // optional A boolean Property specifying the visibility of the volume.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the line strip.
shape: undefined, // optional A Property specifying the array of Cartesian2 positions which define the shape to be extruded.
cornerType: this._cesium.CornerType.ROUNDED, // optional A CornerType Property specifying the style of the corners.
granularity: this._cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the volume is filled with the provided material.
material: this._cesium.Color.WHITE, //optional ,//A Property specifying the material used to fill the volume.
outline: false, //optional A boolean Property specifying whether the volume is outlined.
outlineColor: this._cesium.Color.BLACK, //optional A Property specifying the Color of the outline.
outlineWidth: 1.0, //optional A numeric Property specifying the width of the outline.
shadows: this._cesium.ShadowMode.DISABLED, // optional An enum Property specifying whether the volume casts or receives shadows from each light source.
level_max: 20,
level_min: 10,
}
GroupID:''
checked:true
disFnc:function(){}
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
geoOptions |
object
|
geo参数配置 |
styleOption |
object
|
样式参数配置 |
GroupID |
string
|
组编号 |
checked |
bool
|
是否显示 |
disFnc |
object
|
function(){} |
返回:
结果:
Throws:
- Version:
创建墙图层 *
createWallGeoFeatureLayer(name, geojsonOrurl, option, disFnc) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
name |
String
|
可选
图层名称。 |
geojsonOrurl |
object
|
String
|
可选
geojosn对象或者地址 |
option |
object
|
可选
参数对象{
show: true, // optional A boolean Property specifying the visibility of the wall.
positions: [], // optional A Property specifying the array of Cartesian3 positions which define the top of the wall.
minimumHeights: [], // optional A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
maximumHeights: [], // optional A Property specifying an array of heights to be used for the top of the wall instead of the height of each position.
granularity: Cesium.Math.RADIANS_PER_DEGREE, // optional A numeric Property specifying the angular distance between each latitude and longitude point.
fill: true, // optional A boolean Property specifying whether the wall is filled with the provided material.
material: Color.WHITE, // optional A Property specifying the material used to fill the wall.
outline: false, // optional A boolean Property specifying whether the wall is outlined.
outlineColor: Color.BLACK, // optional A Property specifying the Color of the outline.
outlineWidth: 1.0, // optional A numeric Property specifying the width of the outline.
shadows: ShadowMode.DISABLED, // optional An enum Property specifying whether the wall casts or receives shadows from each light source.
} |
disFnc |
function
|
可选
回调函数 |
返回:
返回一个Cesium的datasource对象。
向三维场景中添加水面图层。
调用方法:
model = sgworld.Creator.createWaterPolygonLayer({
url: './static/json/changjiang.json',
speed: 5
});
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id(可选)。 |
url |
String
|
|
可选
geojson路径。 |
color |
String
|
"rgba(135,206,235,0.6)"
|
可选
水面颜色。 |
image |
String
|
|
可选
水面贴图。 |
height |
Number
|
|
可选
水面高度,无高度和拉伸高度默认贴地。 |
extrudedHeight |
Number
|
|
可选
水面拉伸高度,无高度和拉伸高度默认贴地。 |
frequency |
Number
|
1000
|
可选
水波数。 |
speed |
Number
|
10
|
可选
流速(m/s)。 |
amplitude |
Number
|
10
|
可选
水波幅度。 |
classificationType |
Number
|
|
可选
识别的贴地类型。 |
near |
Number
|
0
|
可选
最小可视距离。 |
far |
Number
|
Math.MAX_VALUE
|
可选
最大可视距离。 |
|
返回:
返回一个WaterGeoJsonFeatureLayer对象。
Creator.createWebMapServerImageLayer(name,option,GroupID,index,checked,disFnc) 创建webimagelayer图层
createWebMapServerImageLayer(name, option, GroupID, index, checked, disFnc) → item:layer
调用方法:
{object} 参数说明
name: this._viewer.camera.position.clone(),
option: {
url: "", //Resource | String The URL of the WMS service. The URL supports the same keywords as the UrlTemplateImageryProvider.
layers: "", //The layers to include, separated by commas.
parameters: {
service: 'WMS',
format: 'image/png',
transparent: true,
},// Object WebMapServiceImageryProvider.DefaultParameters optional Additional parameters to pass to the WMS server in the GetMap URL.
//getFeatureInfoParameters Object WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters optional Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
enablePickFeatures: true,// optional If true, WebMapServiceImageryProvider#pickFeatures will invoke the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, WebMapServiceImageryProvider#pickFeatures will immediately return undefined (indicating no pickable features) without communicating with the server. Set this property to false if you know your WMS server does not support GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
//getFeatureInfoFormats Array.<GetFeatureInfoFormat> WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats optional The formats in which to try WMS GetFeatureInfo requests.
rectangle: this._cesium.Rectangle.MAX_VALUE,// optional The rectangle of the layer.
//tilingScheme : new this._cesium.GeographicTilingScheme(),// optional The tiling scheme to use to divide the world into tiles.
//ellipsoid Ellipsoid optional The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used.
tileWidth: 256,// optional The width of each tile in pixels.
tileHeight: 256,// optional The height of each tile in pixels.
minimumLevel: 0,// optional The minimum level-of-detail supported by the imagery provider. Take care when specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely to result in rendering problems.
maximumLevel: undefined,// optional The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. If not specified, there is no limit.
crs: "",// optional CRS specification, for use with WMS specification >= 1.3.0.
srs: "",// optional SRS specification, for use with WMS specification 1.1.0 or 1.1.1
credit: "", //optional A credit for the data source, which is displayed on the canvas.
subdomains: "",// | Array.<String> 'abc' optional The subdomains to use for the {s} placeholder in the URL template. If this parameter is a single string, each character in the string is a subdomain. If it is an array, each element in the array is a subdomain.
},
GroupID: 0,
disFnc:function(){}
参数描述:
名称 |
类型 |
描述 |
name |
String
|
|
option |
object
|
|
GroupID |
object
|
|
index |
object
|
|
checked |
bool
|
|
disFnc |
object
|
|
返回:
结果:
Throws:
- Version:
- 3.1.0
创建webimagelayer图层
创建
创建WMTS影像图层
createWebMapTileServerImageLayer(name, option, GroupID, index, checked, disFnc) → ImageryLayer
调用方法:
let dx = {
url: 'http://183.162.245.49:8099/geoserver/gwc/service/wmts?layer=topp:states&TileMatrixSet={TileMatrixSet}&TileMatrix={TileMatrixSet}:{TileMatrix}&&TileRow={TileRow}&TileCol={TileCol}&format=image/png&request=GetTile',
tileMatrixSetID: 'EPSG:4326',
tilingScheme: new Cesium.GeographicTilingScheme()
};
var imageProvider = sgworld.Creator.createWebMapTileServerImageLayer("Geoserver-WMTS", dx, "0", undefined, true, "");
参数描述:
名称 |
类型 |
描述 |
name |
String
|
名称 |
option |
Object
|
Cesium.WebMapTileServiceImageryProvider.ConstructorOptions
|
参数
名称 |
类型 |
默认值 |
描述 |
id |
String
|
|
可选
id |
url |
String
|
|
地址 |
alpha |
Number
|
1
|
可选
透明度 |
tilingScheme |
Cesium.TilingScheme
|
|
可选
切片方式 |
Level |
String
|
Number
|
|
可选
显示级别,如18,或"5,18"" |
|
GroupID |
String
|
可选
|
index |
Number
|
可选
影像优先级 |
checked |
Boolean
|
是否勾选 |
disFnc |
function
|
可选
回调函数 |
返回:
返回ImageryLayer对象
这个方法用于添加风场
参数描述:
名称 |
类型 |
描述 |
url |
string
|
可选
风场配置文件url |
option |
Object
|
可选
参数。{
color:颜色,默认'#ffffff'
speed:速度,默认0.15
num:粒子数,默认2000
maxAge:最大存活时间,默认10
brighten:亮度,默认1.5
} |
createWMTSTerrain(name, option, GroupID, checked, Description) → item:layer
调用方法:
{object} 参数说明
name:名称
option:{
url: url,
layerName: layerName,
requestVertexNormals: requestVertexNormals,
token: token
}
GroupID:''
checked:true
Description:''
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
option |
object
|
option |
GroupID |
string
|
组编号 |
checked |
bool
|
是否显示 |
Description |
string
|
'' |
返回:
结果:
Throws:
- Version:
- 3.1.0
地形加载不加载json文件(江苏测绘院)
创建
Creator.CZML(czml,option,callback) 向三维场景中添加CZML
调用方法:
{object} 参数说明
czml:czml
option:{
linkColor: '#0000ff', //链路线颜色(可选)
linkPointColor: '#ffffff', //链路点颜色(可选)
linkTime: 3000, //链路时间(可选)
coneRadarColor: '#0000ff', //卫星雷达颜色(可选)
multiCircleColor: '#ff0000', //扩散圆颜色[多环](可选)
multiCircleTime: 3000, //扩散圆时间[多环](可选)
sectorScanColor: '#ff0000', //扇形扩散颜色(可选)
sectorScanAngle: 45, //扇形扩散角度(可选)
circleScanColor: '#ff0000', //扩散圆颜色(可选)
circleScanTime: 3000, //扩散圆时间(可选)
radarScanColor: '#ff0000', //雷达扫描颜色(可选)
radarScanTime: 3000, //雷达扫描时间(可选)
}
callback:function(){}
参数描述:
名称 |
类型 |
描述 |
czml |
string
|
czml |
option |
object
|
|
callback |
object
|
function(){} |
返回:
结果:
Throws:
- Version:
Creator.DeleteObject(obj) 删除对象
调用方法:
{object} 参数说明
obj
参数描述:
返回:
结果:
Throws:
- Version:
向三维场景中添加面。
executeEllipsoid(Geometry, LineColor) → Promise.<Object>
参数描述:
名称 |
类型 |
描述 |
Geometry |
Array
|
可选
一个经纬度数组 例如:[{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204},{x: 1241183.5017659152, y: -4980441.651928518, z: 3769366.996495204}]。 |
LineColor |
String
|
可选
线的颜色。 |
返回:
返回一个Cesium的对象。
Creator.executeSignout() 浏览方式:暂停浏览
返回:
结果:
Throws:
- Version:
Creator.executeSignout() 浏览方式:向前飞行漫游路径
返回:
结果:
Throws:
- Version:
Creator.executeSignout() 浏览方式:向后飞行漫游路径
返回:
结果:
Throws:
- Version:
Creator.executeSignout() 浏览方式:退出飞行漫游路径
返回:
结果:
Throws:
- Version:
三维场强
参数描述:
名称 |
类型 |
描述 |
url |
String
|
数据地址 |
option |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
grid |
Boolean
|
true
|
可选
是否格网 |
center |
Array
|
|
可选
备用中心点(如果数据中不包含中心点则使用当前中心点) |
flyTo |
Boolean
|
false
|
可选
是否定位 |
scale |
Number
|
1
|
可选
场强比例大小 |
minColor |
String
|
"#ff0000"
|
可选
最小强度颜色 |
maxColor |
String
|
"#00ff00"
|
可选
最大强度颜色 |
|
添加天地图三维注记。
调用方法:
var wtfs = sgworld.Creator.GeoWTFS({
token: 'c53eb074c3fcba5ac86103d4d711bbe8',
url: 'https://t{s}.tianditu.gov.cn/',
subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
});
参数描述:
名称 |
类型 |
描述 |
option |
Object
|
可选
参数
名称 |
类型 |
描述 |
token |
String
|
可选
token |
url |
String
|
可选
服务地址 |
|
返回:
根据坐标获取路径动画数据
参数描述:
名称 |
类型 |
描述 |
degreesArr |
Array.<(Degrees|Number)>
|
坐标串 |
callback |
function
|
回调函数 |
设置所有3dtiles透明度(对3dtiles有特殊颜色设置的不建议使用此方法)。
参数描述:
名称 |
类型 |
描述 |
alpha |
number
|
可选
透明度。 |
设置空间背景
调用方法:
sgworld.Creator.setSpaceBackground('http://183.162.245.49:82/05sdkdemo/src/static/image/background.jpg');
参数描述:
名称 |
类型 |
描述 |
URL |
String
|
背景图片地址 |
返回:
Creator.sfsterrainprovider(name,option,GroupID,checked,Description) sgs地形加载
sfsterrainprovider(name, option, GroupID, checked, Description) → item:layer
调用方法:
{object} 参数说明
name:名称
option:{
url: url,
layerName: layerName,
requestVertexNormals: requestVertexNormals,
token: token
}
GroupID:''
checked:true
Description:''
参数描述:
名称 |
类型 |
描述 |
name |
string
|
名称 |
option |
object
|
option |
GroupID |
string
|
组编号 |
checked |
bool
|
是否显示 |
Description |
string
|
'' |
返回:
结果:
Throws:
- Version:
加载sgs7.1地形
sfsterrainprovider71(name, option, GroupID, checked, Description)
参数描述:
名称 |
类型 |
描述 |
name |
*
|
|
option |
*
|
|
GroupID |
*
|
|
checked |
*
|
|
Description |
*
|
|
向三维场景中添加天空盒子。
调用方法:
var skyBox = sgworld.Creator.SkyBox(true, {
positiveX: 'http://183.162.245.49:82/05sdkdemo/src/static/image/rightav9.jpg',
negativeX: 'http://183.162.245.49:82/05sdkdemo/src/static/image/leftav9.jpg',
positiveY: 'http://183.162.245.49:82/05sdkdemo/src/static/image/frontav9.jpg',
negativeY: 'http://183.162.245.49:82/05sdkdemo/src/static/image/backav9.jpg',
positiveZ: 'http://183.162.245.49:82/05sdkdemo/src/static/image/topav9.jpg',
negativeZ: 'http://183.162.245.49:82/05sdkdemo/src/static/image/bottomav9.jpg'
});
参数描述:
名称 |
类型 |
描述 |
NearGround |
Boolean
|
可选
是否近地。 |
Images |
Object
|
可选
天空盒子图。
名称 |
类型 |
描述 |
positiveX |
String
|
可选
天空盒子图。 |
negativeX |
String
|
可选
天空盒子图。 |
positiveY |
String
|
可选
天空盒子图。 |
negativeY |
String
|
可选
天空盒子图。 |
positiveZ |
String
|
可选
天空盒子图。 |
negativeZ |
String
|
可选
天空盒子图。 |
|
返回:
返回一个SkyBox的对象。
向三维场景中添加视频。
参数描述:
名称 |
类型 |
描述 |
options |
Object
|
可选
参数。
名称 |
类型 |
默认值 |
描述 |
cameraPosition |
Cesium.Cartesian3
|
|
可选
相机位置 |
position |
Cesium.Cartesian3
|
|
可选
投射位置 |
alpha |
Number
|
0.7
|
可选
透明度 |
url |
String
|
|
可选
视频地址 |
type |
String
|
'mp4'
|
可选
视频类型 |
video |
DOM
|
|
可选
视频容器,(可选) |
horizonAngle |
Number
|
60
|
可选
相机水平视角 |
verticalAngle |
Number
|
30
|
可选
相机垂直视角 |
offset |
Number
|
0.1
|
可选
视频四周羽化比例 |
angleZ |
Number
|
0
|
可选
视频在投影面上得旋转角度 |
near |
Number
|
1
|
可选
最近投射面距离 |
far |
Number
|
30
|
可选
最远投射面距离 |
useLine |
Boolean
|
true
|
可选
是否试用辅助线 |
|
返回: