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

编辑操作类.

该类通过鼠标对 FeaturesLayer 中的矢量要素几何形状进行编辑。当地物呈编辑状态时,系统会显示选中地物的结点,通过增加、移动或删除结点来编辑地物形状,也可以通过键盘快捷键和相应接口来撤销或重做编辑状态。鼠标和键盘操作如下:
1.鼠标左键选中地物开始编辑;
2.鼠标左键单击地物边界,增加结点;
3.鼠标左键双击结点,移除结点;
4.鼠标左键选中结点并拖动鼠标,移动结点;
5.点击Z键撤销当前编辑,返回到上一次编辑状态或点击Y键重做下一次的编辑状态;
6.在地物内部或外部双击鼠标或点击 ESC 键,结束编辑;
7.当在不同的编辑对象之间切换时,单击其它对象,当前的编辑操作即可结束。

【注意】目前编辑不支持 PictureFillStyle 样式的面要素。



公共属性
  属性 定义方
    hoverLineStyle : PredefinedLineStyle
获取或设置要素呈现编辑状态时的边界样式。默认宽度为 2px。
Edit
    isFirstViewFeature : Boolean
[read-only] 编辑状态undo(撤销)过程中,表示是否为第一次编辑状态,如果值为 true,表示当前的编辑状态不是最后一次可撤销的历史状态。
Edit
    isLastViewFeature : Boolean
[read-only] 编辑状态redo(重做)过程中,表示是否为最后一次编辑状态,如果值为 true,表示当前的编辑状态不是最后一次可重做的历史状态。
Edit
  Inherited map : Map
获取或设置与交互操作绑定的地图控件。
MapAction
  Inherited snap : Snap
获取或设置捕捉参数类。(SuperMap iServer 7.0及以上版本支持)
DrawAction
    snapStyle : PredefinedMarkerStyle
获取或设置添加结点时的提示标记样式。默认为大小 10px。
Edit
  Inherited style : Style
获取或设置绘制的要素样式。
DrawAction
    vertexStyle : PredefinedMarkerStyle
获取或设置要素呈现编辑状态时的结点样式。默认大小为 10px。
Edit
受保护的属性
  属性 定义方
  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
公共方法
  方法 定义方
   
Edit(map:Map, featureLayer:FeaturesLayer)
初始化 Edit 类的新实例。
Edit
  Inherited
MapAction
  Inherited
setCursor(value:Class, xOffset:Number = 0, yOffset:Number = 0):void
定义鼠标样式的类对象。
MapAction
   
setKeyboardEnabled(key:Number, isEnable:Boolean):void
设置键盘所支持的快捷键是否可用。
Edit
   
updateCurrentPartFeature(point2Ds:Array, partIndex:int):void
Edit
   
浏览下一次编辑状态即redo(重做)当前状态的下一次编辑状态,点击Z键与该方法等效。
Edit
   
浏览上一次编辑状态即undo(撤销)当前编辑状态,点击Y键与该方法等效。
Edit
受保护的方法
  方法 定义方
  Inherited
endDraw(endPoint:Point2D = null):void
矢量要素绘制完成时调用该函数。在此函数中系统会派发 DrawEvent.DRAW_END 事件,用户若要获取绘制的要素 Feature 对象,通过 DrawAction 对象监听 DrawEvent.DRAW_END 事件即可。
DrawAction
  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 事件的侦听函数。
Edit
  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
公共常量
  常量 定义方
    KEY_ESC : Number = 27
[static] 快捷键 ESC 的键值为27。
Edit
    KEY_Y : Number = 89
[static] 快捷键 Y 的键值为89。
Edit
    KEY_Z : Number = 90
[static] 快捷键 Z 的键值为90。
Edit
属性详细信息
hoverLineStyle 属性
hoverLineStyle:PredefinedLineStyle

获取或设置要素呈现编辑状态时的边界样式。默认宽度为 2px。


Implementation
    public function get hoverLineStyle():PredefinedLineStyle
    public function set hoverLineStyle(value:PredefinedLineStyle):void
isFirstViewFeature 属性  
isFirstViewFeature:Boolean  [read-only]

编辑状态undo(撤销)过程中,表示是否为第一次编辑状态,如果值为 true,表示当前的编辑状态不是最后一次可撤销的历史状态。


Implementation
    public function get isFirstViewFeature():Boolean
isLastViewFeature 属性  
isLastViewFeature:Boolean  [read-only]

编辑状态redo(重做)过程中,表示是否为最后一次编辑状态,如果值为 true,表示当前的编辑状态不是最后一次可重做的历史状态。


Implementation
    public function get isLastViewFeature():Boolean
snapStyle 属性  
snapStyle:PredefinedMarkerStyle

获取或设置添加结点时的提示标记样式。默认为大小 10px。


Implementation
    public function get snapStyle():PredefinedMarkerStyle
    public function set snapStyle(value:PredefinedMarkerStyle):void
vertexStyle 属性  
vertexStyle:PredefinedMarkerStyle

获取或设置要素呈现编辑状态时的结点样式。默认大小为 10px。


Implementation
    public function get vertexStyle():PredefinedMarkerStyle
    public function set vertexStyle(value:PredefinedMarkerStyle):void
构造函数详细信息
Edit () 构造函数
public function Edit(map:Map, featureLayer:FeaturesLayer)

初始化 Edit 类的新实例。

参数
map:Map — 与编辑操作关联的地图控件。
 
featureLayer:FeaturesLayer — 要编辑的要素图层。
方法详细描述
onMouseDown () 方法
override protected function onMouseDown(event:MouseEvent):void

MouseEvent.MOUSE_DOWN 事件的侦听函数。

参数

event:MouseEvent

setKeyboardEnabled () 方法  
public function setKeyboardEnabled(key:Number, isEnable:Boolean):void

设置键盘所支持的快捷键是否可用。

参数

key:Number — 键盘上的键值,目前支持的快捷键以及键值如下:
 
isEnable:Boolean — 当前指示的快捷键是否可用。(SuperMap iServer 7.0及以上版本支持)

updateCurrentPartFeature () 方法  
public function updateCurrentPartFeature(point2Ds:Array, partIndex:int):void

参数

point2Ds:Array
 
partIndex:int

viewNextFeature () 方法  
public function viewNextFeature():void

浏览下一次编辑状态即redo(重做)当前状态的下一次编辑状态,点击Z键与该方法等效。

viewPreFeature () 方法  
public function viewPreFeature():void

浏览上一次编辑状态即undo(撤销)当前编辑状态,点击Y键与该方法等效。

常量描述
KEY_ESC 常量
public static const KEY_ESC:Number = 27

快捷键 ESC 的键值为27。

KEY_Y 常量  
public static const KEY_Y:Number = 89

快捷键 Y 的键值为89。

KEY_Z 常量  
public static const KEY_Z:Number = 90

快捷键 Z 的键值为90。