What am I doing wrong.It doesnt want to zoom to this location using this query.Any ideas why. I think because the field I am searching is a double.Could someone guide me of doing a simple query that searches for that number.[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" backgroundColor="0xEEEEEE" pageTitle="Query, then zoom to results"> <s:layout> <s:VerticalLayout gap="0"/> </s:layout> <fx:Script> <![CDATA[ import com.esri.ags.FeatureSet; import com.esri.ags.utils.GraphicUtil; import mx.collections.ArrayCollection; import mx.collections.ArrayList; import mx.controls.Alert; import mx.rpc.AsyncResponder; private function doQuery():void { Number(fText.text); // clear the graphics layer myGraphicsLayer.clear(); queryTask.execute(query, new AsyncResponder(onResult, onFault)); function onResult(featureSet:FeatureSet, token:Object = null):void { if (featureSet.features.length == 0) { Alert.show("No States found. Please try again."); } else { var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features); if (graphicsExtent) { map.extent = graphicsExtent; } } } function onFault(info:Object, token:Object = null):void { Alert.show(info.toString()); } } ]]> </fx:Script> <fx:Declarations> <!-- Symbol for Query Result as Polygon --> <esri:SimpleFillSymbol id="sfs" alpha="0.7"/> <!-- Layer with US States --> <esri:QueryTask id="queryTask" url="http://192.168.0.11:6080/arcgis/rest/services/STEARWEBMAPTEST/MapServer/0"/> <esri:Query id="query" outSpatialReference="{map.spatialReference}" returnGeometry="true" where="StateID = {Number(fText.text)}"> </esri:Query> <s:NumberFormatter id="numberFormatter"/> </fx:Declarations> <s:controlBarLayout> <s:VerticalLayout gap="10" paddingBottom="7" paddingLeft="10" paddingRight="10" paddingTop="7"/> </s:controlBarLayout> <s:controlBarContent> <s:RichText width="100%"> This sample demonstrates how to use the QueryTask to search for features in a specific layer in a map service based upon a string value. If the query returns a result, the GraphicUtil class is used to calculate the extent of the returned features and the map's extent is then set to that extent. </s:RichText> <s:HGroup width="100%" verticalAlign="baseline"> <s:Label text="Search for U.S. States:"/> <s:TextInput id="fText" enter="doQuery()" /> <s:Button click="doQuery()" label="Search"/> </s:HGroup> </s:controlBarContent> <esri:Map id="map"> <esri:extent> <esri:Extent xmin="-1.09742216352E7" ymin="3006114.7661000006" xmax="-1.08446320657E7" ymax="3100223.793400001"> <esri:SpatialReference wkid="102100"/> </esri:Extent> </esri:extent> <esri:ArcGISDynamicMapServiceLayer url="http://192.168.0.11:6080/arcgis/rest/services/STEARWEBMAPTEST/MapServer" /> <esri:GraphicsLayer id="myGraphicsLayer" graphicProvider="{queryTask.executeLastResult.features}" symbol="{sfs}"/> </esri:Map> </s:Application>
[/HTML]