Defintion expression in Flex and defintion queries in the feature class

2190
1
Jump to solution
06-12-2014 11:39 AM
AndrewEdmonds
New Contributor III
Here's a <definitionexpression> problem I hope somebody can help me with...

We have a single feature class from which we generate four web map services based upon a definition query on the STATUS field:

http://gis.ncdcr.gov/ArcGIS/rest/services/NC_National_Register/MapServer/0
http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Study_List/MapServer/0
http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Determined_Eligible/MapServer/0
http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Surveyed_Only/MapServer/0

The first three services are defined using a single parameter, ie Status LIKE 'NR%'.  The last has four parameters (Status = 'SO' OR Status = 'SD' OR Status = 'SA' OR Status = 'BF').  The last is also the only of the four with a scale dependency attached to the display.

I have created a Flex site that further applies a <defintionexpression> against these four WMSs.

The definition expression works for the first three services, but not the last - all data in the service display.  Here's the code from the config file:

    <layer label="Surveyed" type="dynamic" visible="true" alpha="1"              url="http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Surveyed_Only/MapServer" >   <sublayer id="0" popupconfig="popups/PopUp_Surveyed.xml"  definitionexpression="Descriptio LIKE '%Rosenwald%'"  />     </layer>                  <layer label="Determined Eligible" type="dynamic" visible="true" alpha="1"              url="http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Determined_Eligible/MapServer" >   <sublayer id="0" popupconfig="popups/PopUp_DOEs.xml"  definitionexpression="Descriptio LIKE '%Rosenwald%'"  />   <sublayer id="1" popupconfig="popups/PopUp_DOEs_Bdys.xml" definitionexpression="Descriptio LIKE '%Rosenwald%'"  />     </layer>             <layer label="Study List" type="dynamic" visible="true" alpha="1"              url="http://gis.ncdcr.gov/ArcGIS/rest/services/NC_Study_List/MapServer" >   <sublayer id="0"   popupconfig="popups/PopUp_SLs.xml"   definitionexpression="Descriptio LIKE '%Rosenwald%'"  />   <sublayer id="1"   popupconfig="popups/PopUp_SLs_Bdys.xml"   definitionexpression="Descriptio LIKE '%Rosenwald%'"  />     </layer>             <layer label="National Register" type="dynamic" visible="true" alpha="1"              url="http://gis.ncdcr.gov/ArcGIS/rest/services/NC_National_Register/MapServer" >   <sublayer id="0" popupconfig="popups/PopUp_NRs.xml"  definitionexpression="Descriptio LIKE '%Rosenwald%'"  />   <sublayer id="1" popupconfig="popups/PopUp_NRs_Bdys.xml"  definitionexpression="Descriptio LIKE '%Rosenwald%'"  />     </layer>


Oddly, the pop-ups appear to work only for those points (in the last service) queried by the defintionexpression.

I suspect the problem has something to do with the multiple parameters, but does anyone know for sure?

Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AndrewEdmonds
New Contributor III
User error.  I'm posting the solution here in case anyone else ever runs into this.

The definition query used in ArcGIS to generate the fourth WMS - Status = 'SO' OR Status = 'SD' OR Status = 'SA' OR Status = 'BF' - was not contained within parentheses.  So, when we applied the definitionexpression in Flex against it, we got the equivalent of this:

Status = 'SO' OR Status = 'SD' OR Status = 'SA' OR Status = 'BF' AND definitionexpression="Descriptio LIKE '%Rosenwald%'"

I added parentheses to the definition query and eveything worked fine.

View solution in original post

0 Kudos
1 Reply
AndrewEdmonds
New Contributor III
User error.  I'm posting the solution here in case anyone else ever runs into this.

The definition query used in ArcGIS to generate the fourth WMS - Status = 'SO' OR Status = 'SD' OR Status = 'SA' OR Status = 'BF' - was not contained within parentheses.  So, when we applied the definitionexpression in Flex against it, we got the equivalent of this:

Status = 'SO' OR Status = 'SD' OR Status = 'SA' OR Status = 'BF' AND definitionexpression="Descriptio LIKE '%Rosenwald%'"

I added parentheses to the definition query and eveything worked fine.
0 Kudos