BasePlot

BasePlot

标绘基类

Constructor

new BasePlot(viewer, style)

Description:
  • 标绘基类,一般不直接实例化,而实例化其子类(见下方Classes)
Parameters:
Name Type Description
viewer Cesium.Viewer 地图viewer对象
style Object 样式属性

Classes

BasePlot
CreateArrow
CreateBillboard
CreateCircle
CreateGltfModel
CreateLabel
CreatePoint
CreatePolygon
CreatePolyline

Members

entity

Description:
  • 图标entity对象
Properties:
Name Type Description
entity Cesium.Entity entity对象
图标entity对象

objId

Properties:
Name Type Description
objId String | Number 唯一id

positions

Properties:
Name Type Description
positions Array.<Cesium.Cartesian3> 坐标数组

prompt

Properties:
Name Type Description
prompt Object 鼠标提示框

promptStyle

Properties:
Name Type Description
promptStyle Object 鼠标提示框样式

state

Properties:
Name Type Description
state String 标识当前状态 no startCreate creating endCreate startEdit endEdit editing

style

Properties:
Name Type Description
style Object 样式

type

Properties:
Name Type Description
type String 类型

Methods

destroy()

Description:
  • 销毁

done()

Description:
  • 在当前步骤结束

endCreate()

Description:
  • 结束创建

endEdit(callback)

Description:
  • 结束编辑
Example
plotObj.endEdit(function(entity){})
Parameters:
Name Type Description
callback function 回调函数

getCatesian3FromPX(px) → {Cesium.Cartesian3}

Parameters:
Name Type Description
px Object 像素坐标
Returns:
世界坐标
Type
Cesium.Cartesian3

getEntity() → {Cesium.Entity}

Returns:
实体对象
Type
Cesium.Entity

getLnglats() → {Array}

Description:
  • 获取经纬度坐标
Returns:
经纬度坐标数组
Type
Array

getPositions(isWgs84) → {Array}

Parameters:
Name Type Description
isWgs84 Boolean 是否转化为经纬度
Returns:
坐标数组
Type
Array

remove()

Description:
  • 移除当前entity对象

setClientScale(scale)

Description:
  • 此方法用于 地图界面缩放问题(transform:translate(2))
Parameters:
Name Type Description
scale Number 缩放比例

setOwnProp(prop)

Description:
  • 设置自定义属性
Parameters:
Name Type Description
prop Object 属性

setVisible(visible)

Description:
  • 设置entity对象的显示隐藏
Parameters:
Name Type Description
visible Boolean

startEdit()

Description:
  • 开始编辑

zoomTo()

Description:
  • 缩放至当前绘制的对象