GeoSetbackLineAnalysis

退线分析

new Cesium.GeoSetbackLineAnalysis(options)

Name Type Description
options Object optional 对象具有以下属性
Name Type Default Description
viewer Array optional 三维地球类
coordinates Array optional 用地红线的点坐标数组,每个点由经纬度(单位:度)和高程(单位:米)组成
distance Number 10 optional 退线距离(单位:米),默认10米
directionToRight Boolean false optional 退线方向。true为沿用地红线方向的右侧后退,false为沿用地红线方向的左侧后退。默认为false
landlineColor Color Color.RED optional 用地红线的颜色,默认为Cesium.Color.RED
backlineColor Color Color.PINK optional 退线的颜色,默认为Cesium.Color.PINK
lineWidth Number 5 optional 线宽度,默认为5
backSpaceColor Color Color.YELLOW.withAlpha(0.5) optional 退线空间的颜色, 默认为Cesium.Color.YELLOW.withAlpha(0.5)
extrudedHeight Number 100 optional 退线空间的高度,默认为100
Example:
var geo = new Cesium.GeoSetbackLineAnalysis({
     viewer: viewer,
     distance: 10,
     landlineColor: Cesium.Color.RED,
     backlineColor: Cesium.Color.PINK,
     lineWidth: 5,
     backSpaceColor: Cesium.Color.YELLOW.withAlpha(0.5),
     extrudedHeight: 100
 });
// 设置用地红线点坐标(经纬度、高程)
var coordinates = [
     [114.41049001460442, 30.476871278653746, 33.93945159689302],
     [114.41084194068833, 30.479780160864443, 41.60124424409017],
     [114.41094444544547, 30.48069174633191, 41.806145711147074],
     [114.41092984845501, 30.480750437006687, 41.70495020839203],
     [114.41087008069913, 30.480795851339657, 41.793280153558875],
     [114.41082629324362, 30.480810114585122, 41.851947788808424],
     [114.40982991240577, 30.480888474010683, 42.94447029762088],
 ];
geo.setLandLineCoordinates(coordinates);// 传入用地红线坐标
geo.activate(); // 激活显示用地红线、退线和退线空间
geo.showLandline = false; // 用地红线可见性设置
geo.showBackline = false; // 退线可见性设置
geo.showBackSpace = false; // 退线空间可见性设置
geo.destroy(); // 销毁
Demo:

Members

directionToRight : Boolean

设置退线方向
Default Value: false

showBackline : Boolean

设置退线的可见性
Default Value: true

showBackSpace : Boolean

设置退线空间的可见性
Default Value: true

showLandline : Boolean

设置用地红线的可见性
Default Value: true

Methods

activate()

初始化

clear()

清除退线

destroy()

销毁

setDistance(val)

修改退线距离
Name Type Description
val Number 退线距离(单位:米)

setLandLineCoordinates(coordinates)

传入用地红线顶点坐标数据数组 GeoJson格式为:{type: "Feature", geometry: {type: "Polygon", coordinates: []}, properties: {}}
Name Type Description
coordinates Array 用地红线点坐标数据构成的数组,每个点数据包含经纬度(单位:度)和高程(单位:米)
Example:
var coordinates = [
     [114.41049001460442, 30.476871278653746, 33.93945159689302],
     [114.41084194068833, 30.479780160864443, 41.60124424409017],
     [114.41094444544547, 30.48069174633191, 41.806145711147074],
     [114.41092984845501, 30.480750437006687, 41.70495020839203],
     [114.41087008069913, 30.480795851339657, 41.793280153558875],
     [114.41082629324362, 30.480810114585122, 41.851947788808424],
     [114.40982991240577, 30.480888474010683, 42.94447029762088],
 ];
this.setLandlineCoordinates(coordinates);