Class: MeasureSlopeTool

MeasureSlopeTool

new MeasureSlopeTool(viewer, options)

engineExtensions/tools/MeasureSlopeTool.js, line 2

坡度测量工具

Name Type Description
viewer Object

视图

options Object

包含以下属性的对象

Name Type Default Description
callBack Boolean function(result, positions){} 可选

回调函数

labelCallBack Boolean function(result, label){} 可选

测量完毕后提示框的回调函数,可以覆盖提示内容

disableDepthTestDistance Number Number.POSITIVE_INFINITY 可选

只要小于这个距离深度检测就会失效,就会一直显示在最前面 不会被遮挡

lineColor Cesium.Color 可选

线段颜色

pointColor Cesium.Color 可选

点颜色

style Cesium.LabelStyle Cesium.LabelStyle.FILL 可选

label 文字的样式,支持填充、线框。填充和线框, FILL, OUTLINE, FILL_AND_OUTLINE

font String '12pt 楷体' 可选

label 的字体以及大小 @see https://html.spec.whatwg.org/multipage/canvas.html#text-styles

fillColor Cesium.Color Cesium.Color.WHITE 可选

label 的字体颜色

outlineColor Cesium.Color Cesium.Color.WHITE 可选

label 文字线框的颜色

outlineWidth Number 4.0 可选

label 的外轮廓边线

verticalOrigin Cesium.VerticalOrigin Cesium.VerticalOrigin.BOTTOM 可选

label 的摆放位置

showBackground Boolean true 可选

是否显示 label 的背景

backgroundColor Cesium.Color new Cesium.Color(0, 0, 0, 0.4) 可选

lable 背景的颜色

pixelOffset Cesium.Cartesian2 new Cesium.Cartesian2(0, -4) 可选

label 相对于设定点的偏移位置

isContinueDraw Number true 可选

是否连续绘制,true:是,false:否

isMultiple Number true 可选

是否显示多个测量结果,true:是,false:否

Author:
  • 韩彦生
Example
// ES5引入方式
const { MeasureSlopeTool } = zondy.cesium
// ES6引入方式
import { MeasureSlopeTool } from "@mapgis/webclient-cesium-plugin"

function callBack(arg){ }
var measureSlopeTool = new MeasureSlopeTool(viewer,{callBack:callBack});
measureSlopeTool.startTool();  //开始测量
//measureSlopeTool.stopTool(); //结束测量

Members

angleNumber

坡度值

rightClickReBeginBoolean

右键是否继续重新

Methods

clear()

engineExtensions/tools/MeasureSlopeTool.js, line 169

清除所有测量结果,仍可绘制(绘制事件仍然是激活状态)

startTool()

engineExtensions/tools/MeasureSlopeTool.js, line 59

开始测量

stopTool(isKeepResult)

engineExtensions/tools/MeasureSlopeTool.js, line 150

结束测量,测量工具处于不能绘制(不激活状态)

Name Type Default Description
isKeepResult Boolean false 可选

是否保留测量结果。默认为false不保留测量结果。