Flex开发ArcGIS问题集锦九:怎样使用QueryTask执行空间查询和属性查询
来源:互联网 发布:java需求分析文档 编辑:程序博客网 时间:2024/05/22 23:08
Flex开发ArcGIS问题集锦九:怎样使用QueryTask执行空间查询和属性查询
代码
<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:esri="http://www.esri.com/2008/ags" xmlns:s="library://ns.adobe.com/flex/spark" pageTitle="Query Task (with a map)"><s:layout><s:VerticalLayout gap="10" horizontalAlign="center" paddingBottom="20" paddingLeft="25" paddingRight="25" paddingTop="20"/></s:layout><fx:Script><![CDATA[import com.esri.ags.FeatureSet;import com.esri.ags.Graphic;import com.esri.ags.components.LabelDataRenderer;import mx.controls.Alert;import mx.core.UIComponent;import mx.rpc.AsyncResponder;private function doQuery():void{query.where = "wellName like '%" + qText.text + "%'";queryTask.url = "http://SDRJ-WX/arcgis/rest/services/sample/MapServer/0"; queryTask.execute(query, new AsyncResponder(onResult, onFault));function onResult(featureSet:FeatureSet, token:Object = null):void{myGraphicsLayer.graphicProvider = featureSet.features;datagrid.dataProvider = featureSet.attributes;}function onFault(info:Object, token:Object = null):void{Alert.show(info.toString(), "Query Problem");}}]]></fx:Script><fx:Declarations><!--第一步:实例化QueryTask--><esri:QueryTask id="queryTask" showBusyCursor="true"url="http://SDRJ-WX/arcgis/rest/services/sample/MapServer/0"/><esri:Query id="query"outSpatialReference="{myMap.spatialReference}"returnGeometry="true"><esri:outFields><fx:String>wellName</fx:String><fx:String>wellCode</fx:String></esri:outFields></esri:Query></fx:Declarations><s:Panel height="60" backgroundColor="0xB2BFC6" title="请输入你要搜索的井名"><s:layout><s:HorizontalLayout/></s:layout><s:TextInput id="qText" width="100%" enter="doQuery()" text="三星"/><s:Button click="doQuery()" label="搜索"/></s:Panel><esri:Map id="myMap" width="627" height="416"><esri:extent><esri:Extent xmin="-504.498455000157" ymin=" -10490.0680449995" xmax="10500.1491550003" ymax="507.490945000109"><esri:SpatialReference wkid="2379"/></esri:Extent></esri:extent><!--使用sample地图--><esri:ArcGISDynamicMapServiceLayer url="http://SDRJ-WX/arcgis/rest/services/sample/MapServer"/><esri:GraphicsLayer id="myGraphicsLayer"/></esri:Map><mx:DataGrid id="datagrid" bottom="20" width="200" height="150" horizontalCenter="0" /></s:Application>
效果
到此结束!!!
- Flex开发ArcGIS问题集锦九:怎样使用QueryTask执行空间查询和属性查询
- Flex开发ArcGIS问题集锦六:怎样使用空间引用
- Flex开发ArcGIS问题集锦七:怎样使用导航工具
- ArcGis for flex 中QueryTask查询结果限制(1000)问题
- arcgis for flex api version3.7 教程:3.如何使用QueryTask查询地图服务
- ArcGIS for Android示例解析之空间查询-----QueryTask
- ArcGIS for Android示例解析之空间查询-----QueryTask
- ArcGIS for Android示例解析之空间查询-----QueryTask
- ArcGIS API For JavaScript——空间查询(QueryTask)
- Flex开发ArcGIS问题集锦五:怎样显示本地地图
- Flex开发ArcGIS问题集锦八:怎样使用DrawTool绘制工具
- ArcGIS API for JavaScript 解决identify Task 和QueryTask查询结果限制(1000)问题
- ArcGIS API for Silverlight QueryTask 查询方法使用
- ArcGIS.Server.9.3和ArcGIS API for JavaScript实现语句查询QueryTask(八)
- ArcGIS.Server.9.3和ArcGIS API for JavaScript实现语句查询QueryTask(八)
- Flex开发ArcGIS问题集锦四:怎样显示地图(简单小例子)
- Arcgis for Js之featurelayer实现空间查询和属性查询
- Arcgis for Js之featurelayer实现空间查询和属性查询
- 【按姓氏笔画在word上排列名单的2个小伎俩_乡巴佬下载】
- VS2010添加类失败问题,弹出错误框,提示 CodeModel操作失败,无法访问标记数据库
- 指针辨析:悬垂指针、哑指针、野指针、智能指针
- JUnit4 详解
- mysqlhotcopy 命令详解
- Flex开发ArcGIS问题集锦九:怎样使用QueryTask执行空间查询和属性查询
- linux内核cdev_init系列函数(字符设备DS18B20的注册)
- Android WebView常见问题的解决方案总结----例如Web page not available
- 剑指offer面试题19二叉树的镜像和二叉树的前中后遍历递归和非递归算法
- ListView的Item点击效果
- sqoop安装
- 相关资源
- C语言中标志位笔记
- 更换kernel 或者重新编译init后,注意[init.svc.dhcpcd_eth0]: [running]