Select to view content in your preferred language

FeatureLayer definition expression

3402
3
02-14-2011 11:33 AM
JustinRiggs
Emerging Contributor
I'm attempting to recreate this example:

http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayer_MouseOver_Snapshot

using the source code for the FlexViewer.

I added the feature layer like this:

<operationallayers>
            <layer label="Counties" type="feature" visible="true" alpha=".8"
                url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"
                definitionExpression="STATE_NAME='South Carolina'" />
</operationallayers>

in my config.xml file, but the definition expression isn't working. It's just grabbing all the counties in the country and displaying them all at once.

I looked in the MapManager.mxml file, and it looked to me like you can set the definitionExpression property, but maybe I'm wrong. Can anyone point me in the right direction here?

Justin
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Justin,

I can see where you thought that based on what you say in the MapManager the attribute was called definitionExpression, but it is actually all lower case definitionexpression you have to look the concept page and layer tag for the viewer: http://help.arcgis.com/en/webapps/flexviewer/help/layer_tag.htm.
0 Kudos
JustinRiggs
Emerging Contributor
Thanks Robert, that did the trick. I don't think I would have figured that one out in a million years.
0 Kudos
BjornSvensson
Esri Regular Contributor
Just a general comment - all the tags and properties that you specify in the xml files are lowercase. So while it's good to look at the documentation, as for the casing, all the tags are all lowercase 🙂
0 Kudos