AxisPrimitive

new Cesium.AxisPrimitive(options)

可移动的坐标轴. 当前对象不直接加入到scene.primitives中.new以后无渲染对象
Name Type Description
options Object
Name Type Default Description
scene Scene Scene.
center Cartesian3 坐标轴原点的笛卡尔坐标.
axisPixelLength Number 100 optional 坐标轴像素长度.
width Number 2 optional 坐标轴线像素宽度.
show Boolean true optional 是否显示.
enableInputs Boolean true optional 是否开启鼠标事件响应。
enableUnderGround Boolean true optional 是否允许坐标轴原点移动到地下.
Example:
const axisPrimitive = new Cesium.AxisPrimitive({
    scene : viewer.scene,
    center : new Cesium.Cartesian3.fromRadians(2.041676776922519, 0.5874477138349636, 100)
  })
axisPrimitive = viewer.scene.primitives.add(axisPrimitive);

Members

枚举掩码值,标志拾取和绘制。可以用来设置禁用和选择某个坐标轴或者某个面。其中面上的平行边不支持禁用,仅供内部实现使用
坐标轴原点的三维笛卡尔坐标。

enableInputs : Boolean

是否开启鼠标事件响应。

enableUnderGround : Boolean

是否允许坐标轴原点移动到地下。
原点发生平移的事件。回调函数返回两个参数,一个是移动的向量Cartesian3,另一个是移动以后的原点的坐标Cartesian3。 一般没必要set,想要添加回调直接给moveEvent添加事件监听器就行了,添加回调的方式参考Event
是否显示。
坐标轴线宽

Methods

激活某个轴向或者正交面
Name Type Description
bitMask Number
Example:
axisPrimitive.active(axisPrimitive.BitMask.FLAG_OX)
启用所有的平移操作,取消所有的deactive操作
不激活某个轴向操作或者正交面.禁用后的颜色显示为禁用颜色
Name Type Description
bitMask Number
Example:
axisPrimitive.deactive(axisPrimitive.BitMask.FLAG_OX)
销毁当前对象
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.