查看原文:http://www.ibloger.net/article/348.html
<?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:esri="http://www.esri.com/2008/ags"
pageTitle="浏览ArcGIS Online服务内容">
<!--
Description:
实例应用程序来自ArcGIS Online上不同的map services显示,每一个service服务都能查找更多的内容
Sample application to display different map services from ArcGIS Online,
and to find out more about each service.
Documentation:
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/layers/ArcGISTiledMapServiceLayer.html
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/layers/ArcGISTiledMapServiceLayer.html#tileInfo
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/layers/supportClasses/LOD.html
http://resources.arcgis.com/en/help/main/10.1/#/What_is_ArcGIS_Online/01w100000045000000/
-->
<fx:Script>
<![CDATA[
import mx.controls.Alert;
protected function infoImage_clickHandler(event:MouseEvent):void
{
Alert.show("在ArcGIS Online数据缓存地图服务上,滑块的级别是 " + tiled.tileInfo.lods.length
+ " " + tiled.tileInfo.height + " x " + tiled.tileInfo.width
+ " " + tiled.tileInfo.format // + " tiles.\n\n" + tiled.description
+ "\n\n空间参考是 " + myMap.spatialReference.wkid + ".");
}
]]>
</fx:Script>
<s:controlBarLayout>
<s:VerticalLayout gap="10"
paddingBottom="7"
paddingLeft="10"
paddingRight="10"
paddingTop="7"/>
</s:controlBarLayout>
<s:controlBarContent>
<s:RichText width="100%">
这个示例展示了来世ArcGIS Online上不同的map service,点击图形,查找有关每一个service的更多信息
</s:RichText>
<s:Button bottom="4"
click="navigateToURL(new URLRequest('http://resources.arcgis.com/en/help/main/10.1/#/What_is_ArcGIS_Online/01w100000045000000/'))"
fontWeight="bold"
horizontalCenter="0"
label="了解更多关于ArcGIS Online"/>
</s:controlBarContent>
<esri:Map id="myMap" wrapAround180="true">
<esri:ArcGISTiledMapServiceLayer id="tiled"
load="myMap.lods = tiled.tileInfo.lods"
url="http://server.arcgisonline.com/ArcGIS/rest/services/{servicePicker.selectedItem.toString()}/MapServer"/>
</esri:Map>
<s:Panel height="75"
top="15"
fontWeight="bold"
horizontalCenter="0"
title="选择一个ArcGIS Online服务">
<s:layout>
<s:HorizontalLayout horizontalAlign="center"
paddingLeft="5"
verticalAlign="middle"/>
</s:layout>
<s:DropDownList id="servicePicker"
width="225"
cornerRadius="0"
requireSelection="true"
selectedIndex="1">
<s:ArrayList>
<fx:String>Ocean_Basemap</fx:String>
<fx:String>NatGeo_World_Map</fx:String>
<fx:String>World_Imagery</fx:String>
<fx:String>World_Street_Map</fx:String>
<fx:String>World_Topo_Map</fx:String>
<fx:String>World_Shaded_Relief</fx:String>
<fx:String>Specialty/World_Navigation_Charts</fx:String>
</s:ArrayList>
</s:DropDownList>
<mx:Image id="infoImage"
click="infoImage_clickHandler(event)"
source="@Embed(source='assets/info_bubble.png')"/>
</s:Panel>
</s:Application>
弹出框的内容,可以直接访问WebService地址查看
原为摘录:https://developers.arcgis.com/flex/sample-code/arcgis-online-data.htm