插图:
<?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("4778fee6371d4e83a22786029f30c7e1");
}
protected function webMapUtil_createMapByIdCompleteHandler(event:WebMapEvent):void
{
addElementAt(event.map, 0);
}
]]>
</fx:Script>
<fx:Declarations>
<esri:WebMapUtil id="webMapUtil"
createMapByIdComplete="webMapUtil_createMapByIdCompleteHandler(event)"
fault="Alert.show(event.fault.faultString);"/>
</fx:Declarations>
<s:Label top="10"
fontSize="24"
horizontalCenter="0"
text="ArcGIS.com Web Map"/>
</s:Application>显示结果
arcgis for flex api version3.7 教程:2.通过地图服务的ID添加地图
原文:http://blog.csdn.net/xiliangxiaoke/article/details/44652803