Select to view content in your preferred language

Search widget pop-ups do not function.

2954
6
Jump to solution
11-17-2014 01:18 PM
matthewweber
New Contributor III

I have a search widget that searches a dynamic layer containing 2 feature classes (in a grouped layer in the .mxd). I can get 1 of the layers to search correctly (called "Aliases" below), and clicking on the results zooms to their location and displays the popup. For the second layer ("Primary Streets"), it performs the search and returns the correct records, but clicking on a result does not activate the popup or zoom to the feature's location. Perhaps another set of eyes can find an error in my coding? Or maybe I am missing something else?

Thanks for the help folks!

My .xml for the search widget is:

<layer>

            <name>Aliases</name>

            <url>http://XX.XX.XX/ArcGIS/rest/services/CCC_AliasTool_v10/MapServer/1</url>

            <expression>AliasName LIKE '[value]'</expression>

            <textsearchlabel>Search by Alias Name  [ Example: Main Street or Main% ]:</textsearchlabel>

            <titlefield>Aliases</titlefield>

            <linkfield></linkfield>

            <fields all="false">

                <field name="AliasName" alias="Alias Name"/>

  <field name="PriStName" alias="Primary Street Name"/>

            </fields>

     <symbol>

                <simplelinesymbol color="0x00FFFF" width="2.8"/>

            </symbol>

     <orderbyfields>AliasName ASC</orderbyfields>

  </layer>

  <layer>

            <name>Primary Streets</name>

            <url>http://XX.XX.XX/ArcGIS/rest/services/CCC_AliasTool_v10/MapServer/2</url>

            <expression>StreetName LIKE '[value]'</expression>

            <textsearchlabel>Search by Street Name [ Example: Main Street or Main% ]:</textsearchlabel>

            <titlefield>Primary Streets</titlefield>

            <linkfield></linkfield>

            <fields all="false">

                <field name="StreetName" alias="Street Name"/>

  <field name="ExternalSt" alias="External Street Key"/>

            </fields>

     <symbol>

                <simplelinesymbol color="0x00FFFF" width="2.8"/>

            </symbol>

     <orderbyfields>StreetName ASC</orderbyfields>

  </layer>

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Matthew,

   Shape.STLength is not the same as just the "Shape" field. You need to unhide the Shape field in your MXD and republish.

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Matthew,

   Make sure that your http://XX.XX.XX/ArcGIS/rest/services/CCC_AliasTool_v10/MapServer/2 has the ObjectId and Shape fields visible in your map service.

matthewweber
New Contributor III

Those two fields are visible in the .mxd the service references, would there be somewhere else I would check to see if they are visible?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sure check the Rest Service end point by pasting your url (for that particular layer of the map service) in a browser and hit enter.

This is the typical issue when the search returns results yet will not zoom to the location.

0 Kudos
matthewweber
New Contributor III

Ok, here is what I got from the REST endpoint check...REST.png

It has both ObjectID and Shape.Length noted as fields...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Matthew,

   Shape.STLength is not the same as just the "Shape" field. You need to unhide the Shape field in your MXD and republish.

matthewweber
New Contributor III

That did the trick Robert, thanks as always!

0 Kudos