ArcGIS's network editing operations, which can be thought of as related geoprocessing operations on the web side, require feature service to provide symbolic information and geometric data information. The feature service allows you to create custom rest method nodes that store and query geographic data, such as points, lines, and polygons. Stores custom rendering rules and metadata information, such as place names, ratings, addresses, and so on. Analyze and calculate the stored data.
The featurelayer provided by the ArcGIS API for Flex allows you to get and edit vector map data. Feature Services operates on a Feature layer. Feature layers can do a lot of things by associating referencing a map service or a layer in a feature service for display or manipulation. So, when you need to edit the map feature layer, the feature layer needs to refer to a layer in the feature service.
The web-side map editing operation requires an early release of the feature service, which contains the geo-graphical information and attribute table information for a layer. Therefore, geometry services can be used to complete a series of web editing tasks. In order to be able to use some of the major editing controls in the development API, you must have a running geometry service.
When you perform an edit operation, your Web app tells feature which property information has changed and, if possible, how geographic information changes. When the edits are complete, the feature layer also updates the results after the display edits. Feature services can be a service on ArcGIS online, or it can be a self-built service.
Get data from feature service:
The meaning of getting data from the feature service, or the actual operation, is to initialize a feature layer and display it on the map. When initializing the feature service, all you have to do is set the URL of the Url,feature service you want to use, or it can be a service with credentials for user rights. This section uses public-privileged services and does not require you to provide any user credentials (credentials). Once the layer is added to the map, you can refer to a geometry service.
1 Create a new FB project that introduces ArcGIS-related libraries and namespaces
2 Add a Map control, initially set some property information: Spatial reference, Map display extent, basemap, etc., and finally add a feature layer and set its URL and other information.
The code is as follows:
<s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns:s= "Library://ns.adobe.com/flex/spark" Xmlns:esri = "Http://www.esri.com/2008/ags" <esri:map id= "MyMap" wraparound180= "true" > <esri:extent> < Esri:extent id= "SoCal" xmin= " -13471000" ymin= "3834000" xmax= " -12878000" ymax= "4124000" > <esri: Spatialreference wkid= "102100"/> </esri:Extent> </esri:extent> <esri: Arcgistiledmapservicelayer url= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/ MapServer "/> <esri:featurelayer id=" Incidentsareas " mode=" snapshot " outfields=" [Data_ Security,description] " url=" http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/ OPERATIONS/FEATURESERVER/2 "/></ESRI:MAP>
3 Adding Geometry Service
The code is as follows:
xmlns:s= "Library://ns.adobe.com/flex/spark" xmlns:esri= "Http://www.esri.com/2008/ags" <fx:Declarations> <esri:geometryservice id= "Mygeometryservice" url= "http://sampleserver3.arcgisonline.com/ArcGIS/rest /services/geometry/geometryserver "/></fx:declarations><esri:map id=" MyMap "wrapAround180=" true "> <esri:extent></s:Application>
4 Add the editor control to manipulate the map, which contains a lot of editing features, do not need to be developed separately, all you have to do is bind the relevant geometry service, it is so simple.
The code is as follows:
<esri:featurelayer id= "Incidentsareas" mode= "snapshot" outfields= "[Data_security,description]" Url= "HTTP://SAMPLESERVER3.ARCGISONLINE.COM/ARCGIS/REST/SERVICES/HOMELANDSECURITY/OPERATIONS/FEATURESERVER/2"/ ></esri:Map> <esri:editor id= "Myeditor" width= "100%" height= "$" geometryservice= "{ Mygeometryservice} " map=" {myMap} "/> ....
5 Press down to set the binding editor's featurelayers in the application initialization function code
... xmlns:esri= "http://www.esri.com/2008/ags" initialize= "Application1_initializehandler (Event)" ><FX: script><! [cdata[ import mx.events.FlexEvent; protected function Application1_initializehandler (event:flexevent): void { myeditor.featurelayers = [ Incidentsareas]; }] ></fx:Script>
6 Finally, save the run. Will find layout is unreasonable, let's adjust the page layout.
7 Add a layout tag to the code to control the optimization layout.
... initialize= "Application1_initializehandler (event)" <s:layout> <s:verticallayout/></s: Layout>
8 Set the style of the Infowindow with the style tag.
...<s:layout> <s:VerticalLayout/></s:layout><fx:Style> @namespace S "library:// Ns.adobe.com/flex/spark "; @namespace mx "library://ns.adobe.com/flex/mx"; @namespace Esri "Http://www.esri.com/2008/ags"; esri| Infowindow { background-color: #FFFFFF; Border-thickness:2; } </fx:Style><fx:Script> <![ cdata[ import Mx.events.FlexEvent, .....
9 Save Run App
10 Click a location on the map to highlight the area. When you click Done, the message window will pop up (Infowindow). You can then edit the property information for it
The interface looks like this:
ArcGIS for Flex API version3.7 Tutorial: 5. Edit the map using editor