com.supermap.web.actions
public class DrawText
继承 DrawText Inheritance DrawAction Inheritance MapAction Inheritance flash.events.EventDispatcher

绘制文本操作.

该类用于实现通过鼠标在地图中绘制文本的操作。文本作为一个 Feature 实际上是一个 Geometry 为 GeoPoint,Style 为 TextStyle 的要素点。
绘制操作原理:系统内部定义了临时的要素图层 tempLayer 用于加载用户绘制的要素 tempFeature,当要素绘制完成时系统内部会自动清空此图层,并根据用户绘制的要素 tempFeature 使用 new 方法重新克隆一个新的要素对象 drawFeature(与 tempFeature 的属性完全相同),最终通过派发 DrawEvent.DrawEnd 事件将 drawFeature 存储于 DrawEvent 中。因此用户若想在客户端显示绘制的矢量要素,需通过绘制操作监听 DrawEvent.DrawEnd 事件,从而获取要素并将其添加至客户端要素图层 FeatureLayer 中。

另请参见

com.supermap.web.core.styles.TextStyle


公共属性
  属性 定义方
  Inherited map : Map
获取或设置与交互操作绑定的地图控件。
MapAction
  Inherited snap : Snap
获取或设置捕捉参数类。(SuperMap iServer 7.0及以上版本支持)
DrawAction
  Inherited style : Style
获取或设置绘制的要素样式。
DrawAction
    textStyle : TextStyle
获取或设置文本要素风格。
DrawText
受保护的属性
  属性 定义方
  Inherited actionStarted : Boolean = false
标识绘图操作是否已开始。
DrawAction
  Inherited _cursorClass : Class
MapAction
  Inherited _cursorID : int
MapAction
  Inherited _cursorXOffset : Number = 0
MapAction
  Inherited _cursorYOffset : Number = 0
MapAction
  Inherited drawFeature : Feature = null
最终用于显示的要素。与 tempFeature 相同,通过监听 DrawEvent.DrawEnd 事件获取。
DrawAction
  Inherited _isMouseOut : Boolean
MapAction
  Inherited tempFeature : Feature = null
用户绘制的要素。
DrawAction
  Inherited tempLayer : FeaturesLayer
临时图层,用于存储用户绘制过的要素 tempFeature。.
DrawAction
公共方法
  方法 定义方
   
初始化 DrawText 类的新实例。
DrawText
  Inherited
MapAction
  Inherited
setCursor(value:Class, xOffset:Number = 0, yOffset:Number = 0):void
定义鼠标样式的类对象。
MapAction
受保护的方法
  方法 定义方
  Inherited
endDraw(endPoint:Point2D = null):void
矢量要素绘制完成时调用该函数。在此函数中系统会派发 DrawEvent.DRAW_END 事件,用户若要获取绘制的要素 Feature 对象,通过 DrawAction 对象监听 DrawEvent.DRAW_END 事件即可。
DrawAction
   
onMouseClick(event:MouseEvent):void
[Override] MouseEvent.CLICK 事件的侦听函数。
DrawText
  Inherited
onMouseDoubleClick(event:MouseEvent):void
MouseEvent.DOUBLE_CLICK 事件的侦听函数。
MapAction
  Inherited
onMouseDown(event:MouseEvent):void
MouseEvent.MOUSE_DOWN 事件的侦听函数。
MapAction
  Inherited
onMouseMove(event:MouseEvent):void
MouseEvent.MOUSE_MOVE 事件的侦听函数。
MapAction
  Inherited
onMouseOut(event:MouseEvent):void
MouseEvent.MOUSE_OUT 事件的侦听函数。
MapAction
  Inherited
onMouseOver(event:MouseEvent):void
MouseEvent.MOUSE_OVER 事件的侦听函数。
MapAction
  Inherited
onMouseUp(event:MouseEvent):void
MouseEvent.MOUSE_UP 事件的侦听函数。
MapAction
  Inherited
startDraw(startPoint:Point2D = null):void
矢量要素绘制开始时调用该函数。在此函数中会派发 DrawEvent.DRAW_START 事件。
DrawAction
  Inherited
转变矢量要素绘制类型时调用该函数。
DrawAction
属性详细信息
textStyle 属性
textStyle:TextStyle

获取或设置文本要素风格。


Implementation
    public function get textStyle():TextStyle
    public function set textStyle(value:TextStyle):void
构造函数详细信息
DrawText () 构造函数
public function DrawText(map:Map)

初始化 DrawText 类的新实例。

参数
map:Map — 与绘图操作关联的地图控件。
方法详细描述
onMouseClick () 方法
override protected function onMouseClick(event:MouseEvent):void

MouseEvent.CLICK 事件的侦听函数。

参数

event:MouseEvent