eSearch Question - Spatial Search

2682
14
Jump to solution
09-14-2012 11:35 AM
Scott_Russell
New Contributor III
Hello,

I'm using the AppBuilder 3.0. 

To give an example, have two different SQL expressions to to select a Valves layer.   In the Text Search tab, I'd like the user to be able to query Valves by an ID number, but also have the option to query all valves on a given street.

This is working great so far, but I'd like to omit one of these from the Spatial Search function.  Will this be possible if both queries reference the same REST URL?

I have <spatialsearchlayer>true</spatialsearchlayer> set for the query that I'd like to include in the spatial search tab, and I have <spatialsearchlayer>false</spatialsearchlayer> for the query I'd like to omit from the spatial search tab.  However, I am not seeing any impact from this.  Any ideas?

Thanks,
Scott
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Scott,

   Yes I have just tested in App Builder 3.0 and when I set

<spatialsearchlayer>false</spatialsearchlayer>

That layer is not shown in the dropdown for selectable layer on the spatial search view of the widget.

View solution in original post

0 Kudos
14 Replies
RobertScheitlin__GISP
MVP Emeritus
Scott,

   You would have to list then as two different layers and each different layer would have to have a different name assigned. They can both use the same map service url though.
0 Kudos
Scott_Russell
New Contributor III
This is how I have the two layers set up for different functions.  I have the <name> different so I'm not sure why they are still both showing up in the spatial search.   I decided to paste the code below in case I'm not following what you're saying.



<layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Valves</name>
            <url>http://localhost/arcgis/rest/services/WebMap/MapServer/9</url>
            <expressions>
                <expression alias="Valve ID" textsearchlabel="Search Valve ID:">
                    <values>
                        <value prompt="Example: 100">FACILITYID = '[value]'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Valves</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="FACILITYID" gridfield="true" alias="Valve ID"/>
                <field name="DIAMETER" gridfield="true" alias="Diameter"/>
                <field name="FUNCTION_" gridfield="true" alias="Function"/>
                <field name="TYPE" gridfield="true" alias="Type"/>
                <field name="JOINTTYPE" gridfield="true" gridfieldonly="true" alias="Connection Type"/>
                <field name="MANUFACTURER" gridfield="true" gridfieldonly="true" alias="Manufacturer"/>
                <field name="CURRENTCONDITION" gridfield="true" alias="Current Condition"/>
                <field name="InstallDate" dateformat="MM/dd/yyyy" useutc="true" gridfield="true" gridfieldonly="true" alias="Install Date"/>
                <field name="Designation" gridfield="true" gridfieldonly="true"/>
                <field name="TIES" gridfield="true" gridfieldonly="true" alias="Ties"/>
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"/>
        </layer>


[/HR]


<layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Valves by Street Name</name>
            <url>http://localhost/arcgis/rest/services/WebMap/MapServer/9</url>
            <expressions>
                <expression alias="Valves by Street Name" textsearchlabel="Search for Valves by Street Name:">
                    <values>
                        <value prompt="Example: Bay St">STREETNAME = '[value]'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Valves</graphicalsearchlabel>
            <spatialsearchlayer>false</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="FACILITYID" gridfield="true" alias="Valve ID"/>
                <field name="DIAMETER" gridfield="true" alias="Diameter"/>
                <field name="FUNCTION_" gridfield="true" alias="Function"/>
                <field name="TYPE" gridfield="true" alias="Type"/>
                <field name="JOINTTYPE" gridfield="true" gridfieldonly="true" alias="Connection Type"/>
                <field name="MANUFACTURER" gridfield="true" gridfieldonly="true" alias="Manufacturer"/>
                <field name="CURRENTCONDITION" gridfield="true" alias="Current Condition"/>
                <field name="InstallDate" dateformat="MM/dd/yyyy" useutc="true" gridfield="true" gridfieldonly="true" alias="Install Date"/>
                <field name="Designation" gridfield="true" gridfieldonly="true"/>
                <field name="TIES" gridfield="true" gridfieldonly="true" alias="Ties"/>
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"/>
        </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   So you are saying that you have "Valves" and "Valves by Street Name" listed in your Search entities of drop down list? I tested this and can not reproduce this.
0 Kudos
Scott_Russell
New Contributor III
Yes, both options are available in the drop-down list.
0 Kudos
Scott_Russell
New Contributor III
I have also tried to omit another layer from the spatial search by using:

<spatialsearchlayer>false</spatialsearchlayer>  with no results.

EDIT: Downloaded the implemented 3.0.9 and for some reason experiencing the same issue.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   Post your whole eSearchWidget.xml. I have tested multiple layers and have had no issue puttinh false for that tag and not having those layers show up in the spatial search dropdown.
0 Kudos
Scott_Russell
New Contributor III
Okay, here it is.  Thank you!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   When I use the xml you provided I only get Valves, Hydrants, and Service Point in the spatial search drop down.
0 Kudos
Scott_Russell
New Contributor III
Scott,

   When I use the xml you provided I only get Valves, Hydrants, and Service Point in the spatial search drop down.


Hmmm.. I am baffled then.  Maybe I should make a new site with App Builder.  Maybe something with app builder is getting hung up?  Do you think it has anything to do with that or were you testing with App Builder?
0 Kudos