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]
Edit
    isLastViewFeature : Boolean
[read-only]
Edit
  Inherited map : Map
获取或设置与交互操作绑定的地图控件。
MapAction
    snapStyle : PredefinedMarkerStyle
获取或设置添加结点时的提示标记样式。默认为大小 10px。
Edit
  Inherited style : Style
获取或设置绘制的要素样式。
DrawAction
    vertexStyle : PredefinedMarkerStyle
获取或设置要素呈现编辑状态时的结点样式。默认大小为 10px。
Edit
受保护的属性
  属性 定义方
  Inherited actionStarted : Boolean = false
标识绘图操作是否已开始。
DrawAction
  Inherited drawFeature : Feature = null
最终用于显示的要素。与 tempFeature 相同,通过监听 DrawEvent.DrawEnd 事件获取。
DrawAction
  Inherited tempFeature : Feature = null
用户绘制的要素。
DrawAction
  Inherited tempLayer : FeaturesLayer
临时图层,用于存储用户绘制过的要素 tempFeature。.
DrawAction
公共方法
  方法 定义方
   
Edit(map:Map, featureLayer:FeaturesLayer)
初始化 Edit 类的新实例。
Edit
  Inherited
setCursor(value:Class, xOffset:Number = 0, yOffset:Number = 0):void
定义鼠标样式的类对象。
MapAction
   
Edit
   
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
属性详细信息
hoverLineStyle 属性
hoverLineStyle:PredefinedLineStyle

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


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


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


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

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

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