Select to view content in your preferred language

layerdefinition in dynamic map

419
3
07-07-2011 07:50 PM
SaugatJoshi
New Contributor
Hi guys,

Is there a way to have definition query in the Dynamicmap service layer in Flex viewer(may be mention it in config.xml or somewhere)...I can have it done in a standalone application as in
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=LayerDefinitions

If not where should I look into Flex Viewer. Any directions would be of great help.

Thank you.
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Saugat,

   Currently there is no definitionexpression parameter that can be added to the config.xml for a dynamic map service like there is for feature layer. To add a layerDefinitions to the ArcGISDynamicMapServiceLayer you would have to add code to the MapManager.mxml in the addLayerToMap function where it handles case "dynamic":
0 Kudos
SaugatJoshi
New Contributor
Thank you Robert, I will have a look at it and get in touch if I have any other questions.

Thank you.
0 Kudos
SaugatJoshi
New Contributor
Hi Robert,

Thank you for the help. I have got it up and running. However, I have not got it integrated with the config.xml file, it serves my purpose as this is how I need it, as my definition query changes dynamically. Only drawback I see is it the definitionQuery also returns me the layer name which does not contain any information for that state, and this is directly displayed in the TOC. (It would be great if we could eliminate this, and would be great if someone could hint me as how could I proceed).Hope this helps someone.

1. I have ArcGISDynamicMapServiceLayer url is the config file as it is.
<layer label="USA" type="dynamic" visible="true"
         url="http://............/arcgis/rest/services/USAinfo/MapServer"/>


2. In the MapManager.mxml in the addLayerToMap function where it handles case "dynamic", it was as simple as adding definition query for each layer in the service

dynLayer.layerDefinitions = 
      [
        "state = 'DC''",
        "state = 'DC''",
                                                                "state = 'DC''",
        "state = 'DC''",
                                                                "state = 'DC''",
        "state = 'DC''",
        "state = 'DC''",
      ];  "state = 'DC''",



Thank you.
0 Kudos