An imagery layer that displays tiled image data from a single imagery provider
on a
Globe
.
Name | Type | Default | Description |
---|---|---|---|
labelUrl |
String | 请求到的注记信息 | |
scene |
Scene | 场景对象 | |
options |
Object | Object with the following properties: | |
option.show |
Boolean |
true
|
optional 注记可配置参数 显示性控制 |
option.translucency |
NearFarScalar | 注记可配置参数 相机高度-透明度控制 | |
option.distanceDisplayCondition |
DistanceDisplayCondition | 注记可配置参数 相机高度-可见性控制 | |
option.maxTextLength |
DistanceDisplayCondition |
255
|
optional 注记最大显示长度,默认255 |
option.labelExtend |
Object |
注记可配置参数 注记对象参数 Label |
|
layerInfo |
Object | 从IGS查询到的图层的信息,如最大最小比例尺,避让等 |
Example:
var url = 'http://localhost:6163/igs/rest/g3d/label88204';
var options = {
labelExtend: { scale: 2.0 },
getDocLayerIndexes: function (indexs) {
console.log(indexs);
// 存储单图层
layerIndex = indexs[0];
layer = viewer.scene.layers.getLayer(layerIndex);
console.log(layer);
// 存储图层索引数组
// layerIndex=indexs;
}
};
viewer.scene.layers.appendSceneLayer(url, options);
Members
distanceDisplayCondition : DistanceDisplayCondition
readonly labels : LabelCollection
Example:
{layerIndex: 0, layerName: "构造名称_经纬度", layerType: "4", beginLevel: 0, endLevel: 20}
255
readonly readyPromise : Promise.<MapGISLabelLayer>
translucency : NearFarScalar
Methods
appendLabel(lat, lon, height, lText, options) → Label
添加文字标签
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lat |
Number | 经度 | ||||||||||||||||||||||||||||||||||||||||||||
lon |
Number | 纬度 | ||||||||||||||||||||||||||||||||||||||||||||
height |
Number | 高程 | ||||||||||||||||||||||||||||||||||||||||||||
lText |
String | 标签内容 | ||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
|
Returns:
标签对象 (Label)
Example:
var url = 'http://localhost:6163/igs/rest/g3d/label88204';
var options = {
labelExtend: { scale: 2.0 },
getDocLayerIndexes: function (indexs) {
console.log(indexs);
// 存储单图层
layerIndex = indexs[0];
layer = viewer.scene.layers.getLayer(layerIndex);
console.log(layer);
var label = layer.appendLabel(114.2, 31, 200, '这是一个标签', {
font:'14pt 楷体',
style:Cesium.LabelStyle.FILL_AND_OUTLINE,
verticalOrigin:Cesium.VerticalOrigin.BOTTOM,
pixelOffset:new Cesium.Cartesian2(0, -9)});
}
};
viewer.scene.layers.appendSceneLayer(url, options);
查询Label是否在图层中
Name | Type | Description |
---|---|---|
label |
Label |
Returns:
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other than
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception. Therefore,
assign the return value (undefined
) to the object as done in the example.
Name | Type | Default | Description |
---|---|---|---|
destroy |
Boolean |
true
|
optional 是否销毁内存 |
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
MapGISLabelLayer = MapGISLabelLayer && MapGISLabelLayer.destroy();
See:
getLabelById(id) → Label
通过Id获取图层中的Label
Name | Type | Description |
---|---|---|
id |
String |
Returns:
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
If this object was destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception.
Returns:
True if this object was destroyed; otherwise, false.
移除图层中的Label
Name | Type | Description |
---|---|---|
label |
Label |
Returns:
true为成功移除 false为label不存在