Dynamic plotting based on the ArcGIS Flex API (1.1)

Source: Internet
Author: User

Dynamic plotting API 1.1 version number. Compared to the previous version number 1.0 (click to enter). This version number provides editing capabilities for plotting symbols.

The editing feature has two editing states: Edit control points. Rotates, stretches, and pans the plotting symbol.

Edit the control points for example as seen in:


Rotates, stretches, and pans the plotting symbol, for example, as seen in:

Sample Code Demo

private Var plotdrawtool:plotdrawtool;private var plotedittool:plotedittool;private var linesymbol:simplelinesymbol = New Simplelinesymbol ("Solid", 0X0000FF, 1, 2);p rivate var outline:simplelinesymbol = new Simplelinesymbol ("Solid", 0xff0000, 1, 1);p rivate var fillsymbol:simplefillsymbol = new Simplefillsymbol ("Solid", 0x00ff00, 0.5, outline);p rivate s tatic Const STATE_MOVE_SCALE_ROTATE:INT = 0;private static const State_edit_control_points:int = 1;private var editState: int = 0;private var activeplot:graphic;private function init (): void{//instantiation Drawing Tool This.plotdrawtool = new Plotdrawtool (map) ;//Monitor Draw_end event, draw end can get Plotthis.plotDrawTool.addEventListener (Plotdrawevent.draw_end, Drawendhandler);// Instantiation Editing Tool This.plotedittool = new Plotedittool (map);} Private Function Drawendhandler (event:plotdrawevent): void{//to plot set render symbol if (Event.plotGraphic.geometry is Polygon) Event.plotGraphic.symbol = Fillsymbol;else if (Event.plotGraphic.geometry is Polyline) Event.plotGraphic.symbol = linesymbol;//Display this.grAphicslayer.add (event.plotgraphic);//Set Mouse click event Response Event.plotGraphic.addEventListener (Mouseevent.click, Graphicclickhandler);} Private Function Graphicclickhandler (event:mouseevent): Void{var graphic:graphic = Event.currenttarget as Graphic;if ( Graphic = = This.activeplot) {if (this.editstate = = state_move_scale_rotate) {//Turn on move + edit control Point status This.plotEditTool.activate (plotedittool.move| Plotedittool.edit_control_points, graphic); this.editstate = state_edit_control_points;} else{//Turn on move + rotate zoom State this.plotEditTool.activate (plotedittool.move| Plotedittool.scale_rotate, graphic); this.editstate = State_move_scale_rotate;}} Else{this.activeplot = Graphic;this.plotedittool.activate (plotedittool.move| Plotedittool.edit_control_points, graphic); this.editstate = State_edit_control_points;}]] ></fx:script><ns:map id= "Map" level= "5" > <ns:arcgistiledmapservicelayer url= "http://map.geoq.cn/ Arcgis/rest/services/chinaonlinecommunity/mapserver "/><ns:graphicslayer id=" GraphicsLayer "/></Ns:map><s:group left= "top=" ><s:rect width= "100%" height= "100%" ><s:fill><s: Solidcolor color= "0XCCCCCC" alpha= "0.7"/></s:fill></s:rect><s:vgroup paddingbottom= "10" paddingtop= "paddingleft=" "Ten" paddingright= "><s:hgroup verticalalign=" Middle "><s:label text=" line label " /><s:button label= "arc" click= "{plotdrawtool.activate (Plottypes.arc)}"/><s:button label= "curve" click= "{ Plotdrawtool.activate (Plottypes.curve)} "/></s:hgroup><s:hgroup verticalalign=" Middle "><s: Label text= "Polygon label"/><s:button label= "Round" click= "{plotdrawtool.activate (plottypes.circle)}"/><s:button Label= "Ellipse" click= "{plotdrawtool.activate (Plottypes.ellipse)}"/><s:button label= "Bow" click= "{ Plotdrawtool.activate (Plottypes.lune)} "/><s:button label=" fan "click=" {plotdrawtool.activate ( Plottypes.sector)} "/><s:button label=" closed curve "click=" {plotdrawtool.activate (Plottypes.closed_curve)} "/> <s:button label= "Staging" click= "{PLOTDRAwtool.activate (Plottypes.gathering_place)} "/></s:hgroup><s:hgroup verticalalign=" Middle "><s: Label text= "Arrow"/><s:button label= "Straight Arrow" click= "{plotdrawtool.activate (Plottypes.straight_arrow)}"/><s: Button label= "Thin straight Arrow" click= "{plotdrawtool.activate (Plottypes.fine_arrow)}"/><s:button label= "attack direction" click= "{ Plotdrawtool.activate (Plottypes.assault_direction)} "/><s:button label=" attack direction "click=" {plotDrawTool.activate (Plottypes.attack_arrow)} " /><s:button label= "attack direction (tail)" click= "{plotdrawtool.activate (Plottypes.tailed_attack_arrow)}"/><s: Button label= "clamp" click= "{plotdrawtool.activate (Plottypes.double_arrow)}"/><s:button label= "squad fight" click= "{ Plotdrawtool.activate (Plottypes.squad_combat)} "/><s:button label=" squad battle (tail) "click=" {plotdrawtool.activate ( Plottypes.tailed_squad_combat)} "/></s:hgroup></s:vgroup></s:group>
Demo Sample Code latest version number

You are welcome to use, feedback.

qq:21587252 Email:[email protected]

Dynamic plotting based on the ArcGIS Flex API (1.1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.