`
x放羊的星星
  • 浏览: 36647 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Query result on Map

 
阅读更多
<?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">
	
	<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.Graphic;
			import com.esri.ags.FeatureSet;
			import mx.controls.Alert;
			import mx.rpc.AsyncResponder;
			
			private function doQuery():void
			{
				queryTask.execute(query, new AsyncResponder(onResult, onFault));
				function onResult(featureSet:FeatureSet, token:Object = null):void
				{
					// No code needed in this simple sample, since the
					// graphics layer is bound to the query result using
					// graphicProvider="{queryTask.executeLastResult.features}"
				}
				function onFault(info:Object, token:Object = null):void
				{
					Alert.show(info.toString(), "Query Problem");
				}
			}
		]]>
	</fx:Script>

	
	<fx:Declarations>
		
		<!-- Layer with US States -->
		<esri:QueryTask id="queryTask"
						showBusyCursor="true"
						url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"
						useAMF="false"/>
		
		<esri:Query id="query"
					outSpatialReference="{myMap.spatialReference}"
					returnGeometry="true"
					text="{qText.text}">
			<esri:outFields>
				<fx:String>MED_AGE</fx:String>
				<fx:String>POP2007</fx:String>
			</esri:outFields>
		</esri:Query>

		
	</fx:Declarations>
	
	<s:Panel height="60"
			 backgroundColor="0xB2BFC6"
			 title="Query a layer (search for a state)">
		<s:layout>
			<s:HorizontalLayout/>
		</s:layout>
		<s:TextInput id="qText"
					 width="100%"
					 enter="doQuery()"
					 text="California"/>
		<s:Button click="doQuery()" label="Do Query"/>
	</s:Panel>
	
	<esri:Map id="myMap">
		<esri:extent>
			<esri:Extent xmin="-14298000" ymin="2748000" xmax="-6815000" ymax="7117000">
				<esri:SpatialReference wkid="102100"/>
			</esri:Extent>
		</esri:extent>
		<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer"/>
		<esri:GraphicsLayer id="myGraphicsLayer" graphicProvider="{queryTask.executeLastResult.features}"/>
	</esri:Map>

	
</s:Application>
分享到:
评论

相关推荐

    DbMouse Pro 5.6.3

    Use data preview ofr analysing of query result. GPS Visualiser -Visualise points, polygons, and lines on map. Use Open Street Map, Goole Maps, Bing maps and more than 50 other popular map providers....

    arcgis-samples-flex-develop(arcgis api for flex 3.3版本的例子)

    http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Query_result_on_Map/01nq0000003q000000/上的近200个演示实例包括web端(主要是100多个mxml文件)和mobile端的。 放到flash builder中后绝大...

    hive参数优化总结

    Group by-used to group rows of a query result, based on one or more columns。 四、 减少 Job 数 减少 Job 数是 Hive 中一个非常重要的优化方法,影响着数据处理的速度和效率。减少 Job 数可以通过合并小文件...

    ArcGIS Javascript sdk

    这个SDK允许开发者利用JavaScript语言与ArcGIS Server、ArcGIS Online等服务进行交互,创建丰富的地图和地理分析功能。 ### 1. SDK概述 ArcGIS JavaScript SDK主要包含以下组件: - **API库**: 提供了一系列...

    arcgis_js_v31__api.zip

    1. 查询功能:`esri.tasks.QueryTask`和`esri.tasks.Query`对象用于执行空间和属性查询,如`queryTask.execute(query, function(featureSet) {...})`。 2. 叠加分析:通过`esri.layers.GraphicsLayer`进行图形叠加...

    ArcGIS_Server_9_3_for_Flex_API_初级教程.pdf

    map.identify(event.mapPoint, 100, { layerIds: [0] }, function(result) { // 处理识别结果 }); } ]]&gt; &lt;/esri:MapEvent&gt; &lt;/esri:Map&gt; ``` #### 七、GeometryService的使用 1. **功能介绍** ...

    iClient JS之查询交互(1)示例代码

    if (serviceResult.result && serviceResult.result.features.length &gt; 0) { // 处理查询结果 } }); ``` 4. **处理查询结果**:将查询结果解析并显示在地图上,或者以表格等形式展示给用户。这可能涉及创建新...

    Functional Programming

    - Experiment with LINQ queries to combine functional programming with query syntax. 5. **Optimize Performance** - Optimize your functional code for performance. - Utilize parallel LINQ (PLINQ) for ...

    +Flex+集成到+Java+EE+应用程序的最佳实践(完整源代码)

    &lt;mx:method name="queryAll" result="handleQueryAll(result : ResultEvent)"/&gt; &lt;/mx:RemoteObject&gt; 现在,就可以调用这个名为 flexServiceRO 的 RemoteObject 对象的方法了: 清单 14. 调用 ...

    将 Flex 集成到 Java EE 应用程序的最佳实践(完整源代码)

    &lt;mx:method name="queryAll" result="handleQueryAll(result : ResultEvent)"/&gt; &lt;/mx:RemoteObject&gt; 现在,就可以调用这个名为 flexServiceRO 的 RemoteObject 对象的方法了: 清单 14. 调用 FlexServiceRO...

    mapboxGeoCoder:这是用于mapbox的GeoCoder,您可以通过简单地添加到文件中来创建它

    geocoder.on('result', function(result) { console.log(result); }); document.body.appendChild(geocoder.onAdd(map)); ``` 以上代码展示了如何在HTML页面中集成MapboxGeoCoder,创建地图,以及处理用户...

    SuperMap iClient 6R for JavaScript Feature设置文本风格

    wfsService.events.on({"processCompleted": queryCompleted}); // 发起查询请求 wfsService.query(queryParam); function queryCompleted(event) { var features = event.result.featureCount &gt; 0 ? event....

    Go-goreq是一个力求最简化的golanghttprequest库

    Headers: map[string]string{"Content-Type": "application/json"}, Body: `{ "key": "value" }`, }.Do() ``` ### 响应处理 goreq的`Do`方法返回两个值:一个`Response`对象和一个错误。`Response`对象包含了...

    BobBuilder_app

    Persisted: Any changes made are stored on hard disk, so you never lose data on power outages or crashes. Dictionary: A key/value storage system much like the implementation in .NET. MurMurHash: A ...

    Bochs - The cross platform IA-32 (x86) emulator

    [3001637] CMOS MAP register meaning error [2994370] Cannot build with 3DNow support - these S.F. feature requests were closed/implemented [1510142] Native Windows XP x64 Edition binary [1062553] ...

    Hibernate Reference Documentation3.1

    8.3. Components as Map indices 8.4. Components as composite identifiers 8.5. Dynamic components 9. Inheritance Mapping 9.1. The Three Strategies 9.1.1. Table per class hierarchy 9.1.2. Table per ...

    sigmod2011全部论文(3)

    SkylineSearch: Semantic Ranking and Result Visualization for PubMed (Page 1247) Julia Stoyanovich (University of Pennsylvania) Mayur Lodha (Columbia University) William Mee (Columbia University) ...

    Pandas面试题.pdf

    result = df.apply(function, axis=0) ``` - 其中`axis=0`表示按列应用,`axis=1`表示按行应用。 22. **如何在Pandas中进行多条件筛选?** - 使用布尔索引结合`&`和`|`: ```python filtered_df = df[(df['...

Global site tag (gtag.js) - Google Analytics