com.supermap.web.actions
public class DrawPoint
继承 DrawPoint Inheritance Pan Inheritance MapAction Inheritance flash.events.EventDispatcher

绘制点操作.

该类用于实现通过鼠标在地图中绘制点要素的操作。用户若想设置所绘制的点要素样式,既可以使用系统提供的预定义风格 PredefinedMarkerStyle 来设置 markerStyle 属性;也可以继承 MarkerStyle 类自定义点要素风格进行设置。
绘制操作原理:系统内部定义了临时的要素图层 tempLayer 用于加载用户绘制的要素 tempFeature,当要素绘制完成时系统内部会自动清空此图层,并根据用户绘制的要素 tempFeature 使用 new 方法重新克隆一个新的要素对象 drawFeature(与 tempFeature 的属性完全相同),最终通过派发 DrawEvent.DrawEnd 事件将 drawFeature 存储于 DrawEvent 中。因此用户若想在客户端显示绘制的矢量要素,需通过绘制操作监听 DrawEvent.DrawEnd 事件,从而获取要素并将其添加至客户端要素图层中。



公共属性
  属性 定义方
  Inherited map : Map
获取或设置与交互操作绑定的地图控件。
MapAction
    style : Style
获取或设置绘制的要素样式。
DrawPoint
受保护的属性
  属性 定义方
    actionStarted : Boolean = false
标识绘图操作是否已开始。
DrawPoint
  Inherited _cursorClass : Class
MapAction
  Inherited _cursorID : int
MapAction
  Inherited _cursorXOffset : Number = 0
MapAction
  Inherited _cursorYOffset : Number = 0
MapAction
  Inherited _isMouseOut : Boolean
MapAction
公共方法
  方法 定义方
   
初始化 DrawPoint 类的新实例。
DrawPoint
  Inherited
MapAction
  Inherited
setCursor(value:Class, xOffset:Number = 0, yOffset:Number = 0):void
定义鼠标样式的类对象。
MapAction
受保护的方法
  方法 定义方
   
endDraw(endPoint:Point = null):void
矢量要素绘制完成时调用该函数。在此函数中系统会派发 DrawEvent.DRAW_END 事件,用户若要获取绘制的要素 Feature 对象,通过 DrawAction 对象监听 DrawEvent.DRAW_END 事件即可。
DrawPoint
  Inherited
onMouseClick(event:MouseEvent):void
MouseEvent.CLICK 事件的侦听函数。
MapAction
  Inherited
onMouseDoubleClick(event:MouseEvent):void
MouseEvent.DOUBLE_CLICK 事件的侦听函数。
MapAction
   
onMouseDown(event:MouseEvent):void
[Override] MouseEvent.MOUSE_DOWN 事件的侦听函数。
DrawPoint
  Inherited
onMouseMove(event:MouseEvent):void
MouseEvent.MOUSE_MOVE 事件的侦听函数。
MapAction
   
onMouseOut(event:MouseEvent):void
[Override] MouseEvent.MOUSE_OUT 事件的侦听函数。
DrawPoint
   
onMouseOver(event:MouseEvent):void
[Override] MouseEvent.MOUSE_OVER 事件的侦听函数。
DrawPoint
   
onMouseUp(event:MouseEvent):void
[Override] MouseEvent.MOUSE_UP 事件的侦听函数。
DrawPoint
   
startDraw(startPoint:Point2D = null):void
矢量要素绘制开始时调用该函数。在此函数中会派发 DrawEvent.DRAW_START 事件。
DrawPoint
   
转变矢量要素绘制类型时调用该函数。
DrawPoint
属性详细信息
actionStarted 属性
protected var actionStarted:Boolean = false

标识绘图操作是否已开始。

style 属性  
style:Style

获取或设置绘制的要素样式。


Implementation
    public function get style():Style
    public function set style(value:Style):void
构造函数详细信息
DrawPoint () 构造函数
public function DrawPoint(map:Map)

初始化 DrawPoint 类的新实例。

参数
map:Map — 与绘图操作关联的地图控件。
方法详细描述
endDraw () 方法
protected function endDraw(endPoint:Point = null):void

矢量要素绘制完成时调用该函数。在此函数中系统会派发 DrawEvent.DRAW_END 事件,用户若要获取绘制的要素 Feature 对象,通过 DrawAction 对象监听 DrawEvent.DRAW_END 事件即可。

参数

endPoint:Point (default = null)

onMouseDown () 方法  
override protected function onMouseDown(event:MouseEvent):void

MouseEvent.MOUSE_DOWN 事件的侦听函数。

参数

event:MouseEvent

onMouseOut () 方法  
override protected function onMouseOut(event:MouseEvent):void

MouseEvent.MOUSE_OUT 事件的侦听函数。

参数

event:MouseEvent

onMouseOver () 方法  
override protected function onMouseOver(event:MouseEvent):void

MouseEvent.MOUSE_OVER 事件的侦听函数。

参数

event:MouseEvent

onMouseUp () 方法  
override protected function onMouseUp(event:MouseEvent):void

MouseEvent.MOUSE_UP 事件的侦听函数。

参数

event:MouseEvent

startDraw () 方法  
protected function startDraw(startPoint:Point2D = null):void

矢量要素绘制开始时调用该函数。在此函数中会派发 DrawEvent.DRAW_START 事件。

参数

startPoint:Point2D (default = null)

switchActionHandle () 方法  
protected function switchActionHandle():void

转变矢量要素绘制类型时调用该函数。