Skip to content
andygup edited this page Dec 17, 2012 · 7 revisions

The easiest way to get started is to write a simple "Hello World" mapping application. In this tutorial, we will create a simple MXML file containing a map using ActionScript, compile it and display it using Adobe FlashBuilder.

First, download the ArcGIS API for Flex. This is the core API that contains the SWC library needed by the ArcGIS API Lite for Flex project. Note that ArcGISAPILiteforFlex is a wrapper around the core API exposing it as simple function calls and as demonstrations of how core functions can be used to perform certain tasks.

Next, download the FlexAPILite SWC

Using the Adobe FlashBuilder IDE, start a new Flex Project:

Create New Project

Leave the default settings in the Server wizard form and when in the Build Path form make sure to add the ArcGIS API for Flex SWC and the FlexAPILite SWC:

Build Path

Type or even better, copy and paste the following code:

<?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:views="com.esri.views.*">
    <fx:Script>
    <![CDATA[
        import com.esri.ags.events.MapEvent;

        private function map_loadHandler(event:MapEvent):void
        {
            map.setCenter([ 40.736072, -73.992062 ])
        }
    ]]>
    </fx:Script>
    <views:ESRIMap id="map" load="map_loadHandler(event)"/>
</s:Application>

Save the project, and run it as a Web Application:

Run As Web Application

You should see in your default browser a map of downtown Manhattan:

Hello Map

Congratulations!

Clone this wiki locally