Reference official: https://developers.arcgis.com/flex/guide/getting-started.htm https://developers.arcgis.com/flex/guide/ Tutorial-adding-a-map-with-layers.htm
New Flex Project
- Download and unzip the ArcGIS API Flex zip file. This file contains the Flex ArcGIS API Libs Library (. SWC), Locale, skin Pack file
- in Flash builder, select file > new > flex Project
- in the New Flex Project dialog box, enter a name for the project, for example. ' Myfirstapp '.
- Whether to select the project default workspace location
- Application Type Select web Type
- Select SDK Version
- Next
Here we can not select the app service type and then choose Next
The following options are set by default, click Finish to complete
Add Flex API Library
In Package ExplorerSelect the item in the view, right-click Properties, and choose Flex Build Pathon the left. and then tap Library Path Click add SWC button
Well, now you can write your own ArcGIS program code, Let's say we've created a blank project for the referenced API library.
The primary way to display geographic information in an application is through a map. The Flex API provides a user interface (UI) map component. This component allows you to refer to various network services, such as map and image services for ArcGIS Server, open street maps, Bing Maps, OGC WMS, etc., or from ArcGIS Online (ESRI's cloud) through any of the layers. or reference a preconfigured Web map to display content on your own on-premises ArcGIS portal site.
Flex applications are developed with the ActionScript class library using the Mxml and ActionScript languages. Mxml is a page that uses labels for layout, compared to HTML. ActionScript can learn from comparing JavaScript because it is often the same as code and logic.
Here we will add the UI component of the map in Mxml to learn
To add an Esri namespace namespace reference
in the Editor View in the View , modify the MXML file
<?xml version= "1.0" encoding= "Utf-8"? ><s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns: s= "Library://ns.adobe.com/flex/spark" xmlns:mx= "library://ns.adobe.com/flex/mx" minwidth= "955" minHeight= " " <strong>xmlns:esri=" </strong>></s:Application> "Http://www.esri.com/2008/ags"
new maps and data?? To the UI
Maps are effects that are superimposed on each layer, such as
<?xml version= "1.0" encoding= "Utf-8"? ><s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns: s= "Library://ns.adobe.com/flex/spark" xmlns:mx= "library://ns.adobe.com/flex/mx" xmlns:esri= "http// Www.esri.com/2008/ags " minwidth=" 955 "minheight=" ><fx:Declarations><!--Place non-visual elements (such as services, value objects) here --></fx:declarations><esri:map level= "3" wraparound180= "true" ><esri:center><esri: Webmercatormappoint lat= "0" lon= "0"/></esri:center><esri:arcgistiledmapservicelayer url= "/http Server.arcgisonline.com/arcgis/rest/services/world_street_map/mapserver "/><esri: Arcgisdynamicmapservicelayer alpha= "." Url= "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/ Demographics/esri_population_world/mapserver "/></esri:map></s:application>
The level in the Esri:map component is set to a 3,180-degree view of the map display, set the center, latitude, add Map service layer and other information
Run effect
ArcGIS API for Flex (create a new map project using ArcGIS API for Flex)