1. PhotoFlattening
倾斜压平(只针对featureType为BOSGeo.FeatureType.PHOTO类型的数据--b3dm)
1.1. new PoiGeocoder(options)
Param | Type | Default | Description |
---|---|---|---|
options | Object |
||
[options.width] | Number |
1024 |
压平区域纹理宽度,最好设置为2的次幂数 |
[options.height] | Number |
1024 |
压平区域纹理宽度,最好设置为2的次幂数 |
[options.altitudePrecision] | Number |
1 |
高程精度,低于精度的高度调整,不会及时更新(原因:值保存在纹理中,颜色值会进行四舍五入保留整数),最小值为0 |
[options.heightExtrudedFactor] | Number |
3 |
高度拉伸因子,旨在避免同一区域纹理重叠导致的纹理闪烁问题(会将不同高度顶点相对于压平基准面的落差进行0.1^heightExtrudedFactor的高度偏移) 值越大拉伸越小,0值则没有压平效果,负值则会进行反向拉伸 |
Example
var photoFlattening = new BOSGeo.PhotoFlattening();
1.2. 属性
属性名 | Type | Default | Description |
---|---|---|---|
layers | Array.<Cesium3DTileset> |
参与倾斜压平的Cesium3DTileset图层集合(只针对featureType为BOSGeo.FeatureType.PHOTO类型的数据--b3dm) |
|
altitudePrecision | Number |
1 |
高程精度,低于精度的高度调整,不会及时更新(原因:值保存在纹理中,颜色值会进行四舍五入保留整数),最小值为0,默认为小数点后一位 |
heightExtrudedFactor | Number |
3 |
高度拉伸因子,旨在避免同一区域纹理重叠导致的纹理闪烁问题(会将不同高度顶点相对于压平基准面的落差进行0.1^heightExtrudedFactor的高度偏移) |
1.3. 方法
1.3.1. photoFlattening.addFlattenLayer(layer)
添加需要压平的倾斜图层
Returns : Boolean
| Promise
-
true表示添加成功,false表示添加失败或已经添加过,promise对象则表示异步添加中,promise中返回值表示添加结果
Param | Type | Description |
---|---|---|
layer | Cesium3DTileset |
倾斜图层 |
1.3.2. photoFlattening.addFlattenRegion()
添加新的压平区域
Returns : Boolean
-
undefined表示未能添加成功,否则返回当前添加区域的id
Param | Type | Default | Description |
---|---|---|---|
options | Object |
||
options.positions | Array.<Number> |
压平区域顶点经纬度高程组成的数组,经纬度单位为度,高程单位为米 |
|
[options.name] | String |
'压平区域1' |
|
[options.groundAltitude] | Object |
压平区域地面(参考面)绝对高程,不指定则默认为degrees中最小高程 |
|
[options.height] | Object |
0 |
相对于压平区域地面(参考面)的高程(groundAltitude) |
Example
photoFlattening.addFlattenRegion({
positions: [123.45, 22.1, 0
123.45, 22.2, 0.2
123.46, 22.2, 3],
name: '压平区域1',
height: 10
});
1.3.3. photoFlattening.adjustAltitude(altitude, id)
调整压平区域的绝对高程
Returns : Boolean
-
true表示高度修改成功,false表示高度修改失败(部分/所有图层修改失败)或者不存在该id的压平区域
Param | Type | Description |
---|---|---|
altitude | Number |
压平面的绝对高程 |
id | String |
压平区域的id |
1.3.4. photoFlattening.adjustHeight(height, id)
调整压平区域的相对高度
Returns : Boolean
-
true表示高度修改成功,false表示高度修改失败(部分/所有图层修改失败)或者不存在该id的压平区域
Param | Type | Description |
---|---|---|
height | Number |
压平面相对高度(相对于添加时的地面绝对高程groundAltitude) |
id | String |
压平区域id |
1.3.5. photoFlattening.destroy()
销毁
1.3.6. photoFlattening.flyToAllRegions()
定位到所有压平区域
1.3.7. photoFlattening.flyToFlattenedRegion(id)
定位到压平区域
Param | Type | Description |
---|---|---|
id | String |
压平区域的id |
1.3.8. photoFlattening.removeAllRegions()
移除所有压平区域
1.3.9. photoFlattening.removeFlattenLayer(layerId)
移除不需要压平的倾斜图层
Returns : Boolean
-
true表示删除成功, false表示移除失败或不存在该id的倾斜图层
Param | Type | Description |
---|---|---|
layerId | String |
倾斜图层id |
1.3.10. photoFlattening.removeFlattenedRegion(id)
移除指定id的压平区域
Returns : Boolean
-
true表示移除成功,false表示移除失败(不是所有倾斜的都移除成功)或者不存在该id的压平区域
Param | Type | Description |
---|---|---|
id | String |
压平区域的id |
1.3.11. photoFlattening.renameFlattendRegion(name, id)
重命名压平区域
Returns : Boolean
-
true表示重命名成功,false表示重命名失败(部分/所有的倾斜重命名失败)或者不存在该id的压平区域
Param | Type | Description |
---|---|---|
name | String |
新的压平区域名称 |
id | String |
压平区域的id |