arcgis api for flex 开发入门(一)环境搭建

来源:互联网 发布:重庆生活频道 网络直播 编辑:程序博客网 时间:2024/04/18 19:39
arcgis api for flex 开发入门(一)环境搭建
arcgis api for flex 是arcgis 今年四月新推出来的进行RIA开发的flex库,是arcgis server9.3的一部分,使用  ArcGIS API for Flex可以基于ArcGIS Server建立漂亮的富互联网应用程序 rich internet applications (RIAs) ,优点是运行速度快,用户体验效果会比目前的WEBGIS好。
使用arcgis api for flex 可以达到下面的效果
1,显示你的地图数据并可以和数据交互 
2,在服务器上执行空间处理模型并显示结果 
3,基于ArcGIS Online上的底图显示你自己的数据 
4,根据属性或者位置查找你的数据并显示结果 
5,查找地址并显示结果 
6,用创新的方式可视化结果 
7,创建mashups
具体详情可以参考http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=samples上面有一些例子。
arcgis api for flex  下载地址为
http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=home
里面有个download。
开发arcgis api for flex 的程序需要flex 环境的支持。
flex sdk3 的下载地址为
http://opensource.adobe.com/wiki/display/flexsdk/download?build=3.0.1.2012&pkgtype=1
有了flex sdk3 和arcgis api for flex 我们就可以开发RIA的flex 程序了。
为了开发方便,我们最好使用flex builder,可以从adobe 的官方网站上下载试用版,下载地址为http://download.macromedia.com/pub/flex/flex_builder/FB3_win.exe
安装好flex builder之后会安装flex sdk3 ,所以就不用自己手工安装了。
第一个arcgis api for flex程序。
1,打开flex builder,创建一个flex 工程(名称Demo)。
2,右键单击工程名,选择属性,在属性对话框中选择flex build path ,选择libaray path选项卡,单击add swc 把下载的arcgis api for flex添加进去,环境就配置好了。
1.jpg 
3 ,在Demo.mxml文件中输入下面这代码
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application
  3.     xmlns:mx="http://www.adobe.com/2006/mxml"
  4.     xmlns:esri="http://www.esri.com/2008/ags"
  5.     pageTitle="Using ArcGIS API for Flex to connect to a cached ArcGIS Online service"
  6.     styleName="plain">
  7.     <esri:Map crosshairVisible="true">
  8.         <esri:ArcGISTiledMapServiceLayer
  9.             url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
  10.     </esri:Map>
  11. </mx:Application>
复制代码
编译,执行。第一个简单的ags flex程序就写好了。
效果如图2
2.jpg 



注: 文章部分内容参考了以下文章
http://www.gisempire.com/blog/user1/1/200888102647.html
原文地址:http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=35515&extra=page%3D4%26amp%3Borderby%3Ddateline