Select to view content in your preferred language

layerdefinitions

836
2
09-29-2010 01:20 PM
GaryBushek
Deactivated User
Is it possible to update layerdefinitions at runtime? Im inclined to say no and I would have to run a query task in conjunction with a graphics layer to show the features I want filtered. For what I need to do, it would be nice to just update the layerdefinition for the layer directly but i'm not sure.

Thanks, Gary
Tags (2)
0 Kudos
2 Replies
DanJensen
Deactivated User
Try something like this.

 <fx:Script>
  <![CDATA[
   protected function defQry_clickHandler(event:MouseEvent):void
   {
    var lyrDef:Array = ["", "", "FieldName = '" + textInput.text + "'"];
    mapSvc.layerDefinitions = lyrDef;
   }
  ]]>
 </fx:Script>

 <fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
 </fx:Declarations>
 
 <s:layout>
  <s:VerticalLayout gap="10"
        horizontalAlign="center"
        paddingBottom="20"
        paddingLeft="20"
        paddingRight="20"
        paddingTop="20"/>
 </s:layout>
 <esri:Map id="Map">
  <esri:ArcGISDynamicMapServiceLayer id="mapSvc" url="yourURL"/>
 </esri:Map>
 <s:TextInput id="textInput"/>
 <s:Button id="defQry" click="defQry_clickHandler(event)" label="Click to change layer definition"/>


Good Luck,
-Dan
0 Kudos
GaryBushek
Deactivated User
Thank you, this worked.
0 Kudos