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添加进去,环境就配置好了。
3 ,在Demo.mxml文件中输入下面这代码
1.
3. xmlns:mx=\4. xmlns:esri=\
5. pageTitle=\
service\
6. styleName=\
7. 9. url=\ ap_World_2D/MapServer\10.
arcgis api for flex 开发入门(二)map 的创建
在flex 中创建一个esri 的map ,你只需要使用
creati resize=\mouseMove=\ width和 height定义的map 的大小,id=\唯一标识了这个map。 针对map 的消息也有很多,最常用的就是creationComplete,resize和鼠标消息了。 现在我们map有了,那么我们如何让她显示数据呢,这就需要给 在ags flex api 中有以下几种类型的layer。 ArcGISDynamicMapServiceLayer :Allows you to work with a dynamic map service resource exposed by the ArcGIS Server REST API. ArcGISImageServiceLayer: Allows you to work with an image service resource exposed by the ArcGIS Server REST API. ArcGISMapServiceLayer :The base class for ArcGIS Server map services. ArcGISTiledMapServiceLayer :Allows you to work with a cached map service resource exposed by the ArcGIS Server REST API. ArcIMSMapServiceLayer :Allows you to work with an ArcIMS image service. GPResultImageLayer :Allows you to view a geoprocessing task result identified by jobId and parameterName. GraphicsLayer: A layer that contains one or more Graphic features. 其中GraphicsLayer是支持客户端添加Graphic features的图层,需要在客户端表现的,或者交互操作中产生的要素都要加到这个layer 上。 下面,我们就添加一个ArcGISTiledMapServiceLayer和GraphicsLayer到map 上。 creati resize=\mouseMove=\ 其中 http://resources.esri.com/help/9.3/arcgisserver/apis/REST/index.html?gcs.html中查找。如下为创建一个kid=\的空间参考系。 很简单,在 其中x是经度,y 是纬度。 这样一个北京地区的map 就可以显示到我们面前了。 完整代码如下 xmlns:mx=\ xmlns:esri=\ pageTitle=\ styleName=\> url=\2D/MapServer\ /> arcgis api for flex 开发入门(三)地图浏览控件的使用 地图浏览包括放大,缩小,漫游,复位,上级窗口,下级窗口等 在arcgis api for flex中,esri 已经封装好了一个地图浏览,我们在程序中可 以直接使用,只需要几十行代码,就可以完成复杂的任务。 首先在上一讲的基础上创建一个Navigation 控件。使用 将 然后我们创建一个工具条,用来做对map 浏览的控制 click=\ enabled=\navToolbar.isLastExtent}\
arcgis api for flex 开发入门



