ArcGIS API for Flex (add a Web map to your application)

Source: Internet
Author: User

ADD the Web map to the application

Excerpt from Source: https://developers.arcgis.com/flex/guide/tutorial-add-a-web-map-to-the-application.htm


thisthe Webmaputil class is a Web map project information based on a given ID used to create a map, this class needs to work on an online ArcGIS Web map, or you can use the ArcGIS portal site, and by setting the arcgissharingurl Property , this tutorial uses online ArcGIS maps to learn


In Flash Builder, create a new project and join the Flex API library

In the editor view, add the following code. Also, be sure to reference the ESRI namespace

<?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:esri=" Http://www.esri.com/2008/ags "initialize=" Application_ InitializeHandler (Event) "><fx:Script> <!    [cdata[import com.esri.ags.events.WebMapEvent;    Import Mx.controls.Alert;    Import mx.events.FlexEvent; protected function Application_initializehandler (event:flexevent): void {Webmaputil.createmapbyid ("4778fee6371d4e8    3a22786029f30c7e1 "); } protected function Webmaputil_createmapbyidcompletehandler (event:webmapevent): void {addelementat (event.map, 0    ); }]]></fx:script><fx:declarations> <esri:webmaputil id= "Webmaputil" createMapByIdComplete= "WebMa Putil_createmapbyidcompletehandler (event) "fault=" Alert.show (event.fault.faultString); " /> </fx:declarations><s:label top= "fontsize=" horizontalcenter= "0" text= "ArcGIS.com Web Map"/&G t;</S:application> 

When the program initializeHandlerThe function is triggered and uses the provided Web map ID 4778fee6371d4e83a22786029f30c7e1

Once the map is finished building, thecreateMapByIdCompleteHandlerThe function is triggered and the event is calledSpark container ' s containeraddElementfunctions are passed in the map


Run effect





ArcGIS API for Flex (add a Web map to your application)

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.