<esri:Map id="myMap" mapClick="map_mapClickHandler(event)" openHandCursorVisible="false" wrapAround180="true"> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/> <esri:ArcGISDynamicMapServiceLayer load="{myMap.extent=useforextentLayer.fullExtent}" id="useforextentLayer" url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/CityBoundary_SD/MapServer" /> <esri:FeatureLayer id="fLayer" definitionExpression="STATE_NAME='North Carolina'" fault="fLayer_faultHandler(event)" graphicAdd="fLayer_graphicAddHandler(event)" mode="snapshot" outFields="[Address,own_name,own_addr]" symbol="{countySymbol}" url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0"/> <esri:GraphicsLayer id="highlightGraphicsLayer"/> </esri:Map>
Solved! Go to Solution.
...
The definition expression limits the FeatureLayer to a subset of the available features in the map service layer. It is similar to the definition query for a layer in ArcMap.
...
http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0 Fields: OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID) Sidwell10 (Type: esriFieldTypeString, Alias: Sidwell10, Length: 10 ) Sidwell14 (Type: esriFieldTypeString, Alias: Sidwell14, Length: 14 ) tax_dist (Type: esriFieldTypeString, Alias: tax_dist, Length: 3 ) Address (Type: esriFieldTypeString, Alias: Address, Length: 25 ) Acreage (Type: esriFieldTypeDouble, Alias: Acreage) Adjusted (Type: esriFieldTypeSmallInteger, Alias: Adjusted, Domain: Coded Values: [0: No], [1: Yes] ) Shape (Type: esriFieldTypeGeometry, Alias: Shape) own_name (Type: esriFieldTypeString, Alias: Owner Name, Length: 30 ) own_name_c (Type: esriFieldTypeString, Alias: Additional Owner Name, Length: 30 ) own_addr (Type: esriFieldTypeString, Alias: Owner Address, Length: 25 ) own_cityst (Type: esriFieldTypeString, Alias: Owner City/State, Length: 22 ) own_zip (Type: esriFieldTypeString, Alias: Owner Zip, Length: 5 ) own_zip_fo (Type: esriFieldTypeString, Alias: Owner Zip4, Length: 4 ) Shape_Area (Type: esriFieldTypeDouble, Alias: Area)
...
The definition expression limits the FeatureLayer to a subset of the available features in the map service layer. It is similar to the definition query for a layer in ArcMap.
...
http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0 Fields: OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID) Sidwell10 (Type: esriFieldTypeString, Alias: Sidwell10, Length: 10 ) Sidwell14 (Type: esriFieldTypeString, Alias: Sidwell14, Length: 14 ) tax_dist (Type: esriFieldTypeString, Alias: tax_dist, Length: 3 ) Address (Type: esriFieldTypeString, Alias: Address, Length: 25 ) Acreage (Type: esriFieldTypeDouble, Alias: Acreage) Adjusted (Type: esriFieldTypeSmallInteger, Alias: Adjusted, Domain: Coded Values: [0: No], [1: Yes] ) Shape (Type: esriFieldTypeGeometry, Alias: Shape) own_name (Type: esriFieldTypeString, Alias: Owner Name, Length: 30 ) own_name_c (Type: esriFieldTypeString, Alias: Additional Owner Name, Length: 30 ) own_addr (Type: esriFieldTypeString, Alias: Owner Address, Length: 25 ) own_cityst (Type: esriFieldTypeString, Alias: Owner City/State, Length: 22 ) own_zip (Type: esriFieldTypeString, Alias: Owner Zip, Length: 5 ) own_zip_fo (Type: esriFieldTypeString, Alias: Owner Zip4, Length: 4 ) Shape_Area (Type: esriFieldTypeDouble, Alias: Area)
url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0
<?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"> <!-- Flex SDK v.4.5.1 --> <!-- ArcGIS API v.2.5 --> <s:layout> <s:VerticalLayout paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10" /> </s:layout> <fx:Script> <![CDATA[ import com.esri.ags.Graphic; import com.esri.ags.events.GraphicEvent; import com.esri.ags.events.LayerEvent; import mx.utils.StringUtil; protected function onGraphicAdd(event:GraphicEvent):void { var gr:Graphic = event.graphic; var attr:Object = gr.attributes; gr.toolTip = StringUtil.substitute("Address: {0}\nOwner Name: {1}", attr.Address, attr.own_name); gr.addEventListener(MouseEvent.MOUSE_OVER, function():void{ gr.symbol = overSymbol; }); gr.addEventListener(MouseEvent.MOUSE_OUT, function():void{ gr.symbol = normalSymbol; }); } ]]> </fx:Script> <fx:Declarations> <esri:SimpleFillSymbol id="normalSymbol" color="0xFF0000" alpha="0.8" style="cross"> <esri:outline> <esri:SimpleLineSymbol color="0xFF0000" width="2" /> </esri:outline> </esri:SimpleFillSymbol> <esri:SimpleFillSymbol id="overSymbol" color="0x0000FF" alpha="0.8" style="cross"> <esri:outline> <esri:SimpleLineSymbol color="0x0000FF" width="4" /> </esri:outline> </esri:SimpleFillSymbol> </fx:Declarations> <esri:Map id="map"> <esri:extent> <esri:Extent xmax="-111.834" xmin="-111.837" ymax="40.6316" ymin="40.6312"> <esri:SpatialReference> <esri:wkid>4326</esri:wkid> </esri:SpatialReference> </esri:Extent> </esri:extent> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/> <esri:FeatureLayer mode="snapshot" id="fLayer" graphicAdd="onGraphicAdd(event)" outFields="[Address,own_name,own_addr]" symbol="{normalSymbol}" url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0" /> </esri:Map> </s:Application>
<esri:FeatureLayer mode="snapshot" id="fLayer" graphicAdd="onGraphicAdd(event)" outFields="[Address,own_name,own_addr]" symbol="{normalSymbol}" url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0" />
<esri:FeatureLayer id="fLayer" definitionExpression="Acreage>=0" fault="fLayer_faultHandler(event)" graphicAdd="fLayer_graphicAddHandler(event)" outFields="[Address,own_name,own_addr]" symbol="{countySymbol}" url="http://gis.chcity.org/CHwebMaps/rest/services/CityData/Parcels_SD/MapServer/0"/>
Min. Scale: 15000 Max. Scale: 0