Map Overview:
The ArcGIS for Flex API provides a number of ways to implement map operations and interactions. First, maps support the addition of various types of layers or services. The layer data source can be ArcGIS server, Bing maps, graphics layers, and so on. There are also other services that can be exposed using the network like arcgis.com or self-built. The Web Map service has a similar side, and all types of layers, tasks, and data (data can be expanded, such as. csv and. gpx files) are supported by certain methods. We will discuss this in more detail below.
Create a map and set the display range and spatial reference:
The map component contains one or more layers, which are the containers that the layer overlays display. Creating a map is a basic step. Developers can create a map and add basemaps and action layers by encoding.
Map Range:
Once the map has been created, you can set its display range and spatial reference. The extent of the map's display is usually dependent on the map extent of the provided map service. The display range of the map service is important for setting the initial display range (initial extent) of the map in your app. By default, the initial display extent of a map depends on the information of the first layer of a series of layers in the map. If you want to change the initial scope of the default display, we need to customize it through the code.
...<fx:declarations> <esri:extent id= "initialextent" xmin= " -17731" ymin= "6710077" xmax= "-12495" ymax= "6712279" > </esri:extent></fx:declarations><esri:map extent= "{initialExtent}" > </esri:Map>
Spatial reference (special Reference):
Each map service has a spatial reference. A spatial reference can be a non-projective reference system (such as a geospatial coordinate system) or a projection reference (such as UTM, Mercator). There are many types of coordinate systems, one of the most commonly used coordinate systems is Mercator (Web Mercator), Bing Maps, Google Maps, and Esri online. Each coordinate system corresponds to a wkid. The default spatial reference for the map in your app also takes the spatial reference information for the first layer. If you want to change it can be set by code.
...<fx:declarations> <esri:extent id= "initialextent" xmin= " -17731" ymin= "6710077" xmax= "-12495" ymax= "6712279" > <esri:spatialreference wkid= "102100"/> </esri:extent></fx:d Eclarations><esri:map extent= "{initialextent}" > <esri:arcgistiledmapservicelayer url= "http ://server.arcgisonline.com/arcgis/rest/services/world_street_map/mapserver "/></ESRI:MAP>
Zoom level and display center of the map:
Similar to setting the map's display range, we may also set the map to display to the specified zoom level and center to the specified coordinate point. The map level refers to the ID of the map detail level (LOD) number. It only works if the map itself has lods. For example, this service http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer, there are 20 lods. The service can be opened in the browser to view, in tile info for lods detailed information.
<esri:map level= "wraparound180=" true "> <esri:center> <esri:webmercatormappoint lon="- 0.13 "lat=" 51.51 "/> </esri:center> <esri:arcgistiledmapservicelayer url="/http Server.arcgisonline.com/arcgis/rest/services/world_street_map/mapserver "/></esri:map>
ArcGIS for Flex API version3.7 Tutorial: 8. Create a Map