ArcGIS for Flex API version3.7 Tutorial: 8. Create a Map

Source: Internet
Author: User

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

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.