ArcGIS flex viewer 3.1 Identify Widget

6511
45
02-06-2013 06:52 AM
ManuelRodriguez2
New Contributor
I am fairly new to using custom widgets.  I have copied the compiled widget folder over and added the text the the config.xml file.  The widget loads correctly in the viewer but I can not get it to detect any features in the map at all.  Even with the  <layers onlythese="false">.  Any help would be greatly appreciated.
Tags (2)
0 Kudos
45 Replies
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   So the widget does appear when you click the icon and when you one of the widgets identify tools to draw on the map no results are returned?

In you main config.xml I see one issue. There is currently no space between the config="widgets/Identify/IdentifyWidget.xml" and the label="Identify" This is poor xml syntax and would cause an issue.

        <widget url="widgets/Identify/IdentifyWidget.swf" config="widgets/Identify/IdentifyWidget.xml"label="Identify" icon="assets/images/i_info.png"/>


The other thing I don't like is the extra forward slash behind all your MapServer urls "MapServer/" delete those extra trails forward slashes.
0 Kudos
AndrewIng
New Contributor
Thank I'll give that a try.
0 Kudos
AndrewIng
New Contributor
Hi Robert,
I made the changes to the code and still don't get any results from the Identify Tool from the Property Layer or any other.
Screen grab attached.
Andrew
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   When you leave the drop down list as All Layers does it return any results (make sure you are clicking somewhere you would get other data back, try using the select by rectangle tool)?
0 Kudos
AndrewIng
New Contributor
Yes, I've tried every combination of tool and layer and still nothing?!?
0 Kudos
TristanKnowlton
Occasional Contributor II
I am having a similar issue.  I have a single layer plugged into the Identify widget.  When I click a feature, it highlights it and shows the fields in the widget window.  However it will not populate the field with the attribute data.  The fields are configured with the name of the field according to the rest endpoint and I have given an alias to the field as well.  I have tried everything I can think of to try to solve the problem. 

I have attached a screenshot of the widget in action in my viewer and I have pasted in the .xml file below if anyone would like to take a look and offer any suggestions.

<?xml version="1.0"?>
<configuration>
 <identifylayeroption>all</identifylayeroption>
 <identifytolerance>5</identifytolerance>
 <defaultzoomscale>5000</defaultzoomscale>
 <keepidentifyactive>true</keepidentifyactive>
 <returngeometryforzoom>true</returngeometryforzoom>
 <enablelineselect>true</enablelineselect>
 <enableextentselect>true</enableextentselect>
 <enablepolyselect>true</enablepolyselect>
 <enablemouseovergraphicsinfo>false</enablemouseovergraphicsinfo>
 <enablemouseoverrecordinfo>false</enablemouseoverrecordinfo>
 <enablegraphicclickinfo>false</enablegraphicclickinfo>
 <usemaptime>false</usemaptime>
 <infoautoclosemilliseconds>2000</infoautoclosemilliseconds><!-- 2 seconds -->
 <autoactivatedtool>mappoint</autoactivatedtool><!-- possible values are extent or polygon or mappoint or polyline or nothing -->
 <excludebasemaps>false</excludebasemaps>
 <disablepopuplinks>false</disablepopuplinks>
 <disablelayerdropdown>false</disablelayerdropdown>
 <disablealllayerschoice>true</disablealllayerschoice>
 <labels>
  <zoom2message>Click to Zoom to Point</zoom2message>
  <identifylabel>Identify</identifylabel>
  <resultslabel>Results</resultslabel>
  <descriptionlabel>Use the identify tool to identify features on the map:</descriptionlabel>
  <pointlabel>Identify by Point</pointlabel>
  <linelabel>Identify by Polyline</linelabel>
  <rectlabel>Identify by Rectangle</rectlabel>
  <polylabel>Identify by Polygon</polylabel>
  <clearlabel>Clear</clearlabel>
  <loadinglabel>Loading...</loadinglabel>
  <removeresultmessage>Remove Result</removeresultmessage>
  <idfrom>Identify From</idfrom>
  <noresultsfoundlabel>No Results Found</noresultsfoundlabel>
  <resultsfoundlabel>Results Found</resultsfoundlabel>
  <alllayers>All Layers</alllayers>
  <layersremaining>layers remaining:</layersremaining>
 </labels>
 <useproxy>
  <!-- Enter the label of the MapService from the main config.xml -->
  <!--<proxymapservice label="Imagery" />
  <proxymapservice label="Streets" />-->
 </useproxy>
 <layers onlythese="true">
  <layer>
   <name>Parcels</name>
   <id>48</id>
   <url>http://gis.delhitownship.com/arcgis/rest/services/Public_Website/PW_BaseMap/MapServer</url>
   <fields>
    <field alias="Parcel #" 
        name="PARCELNUM"/>
    <field name="OWNER_NAM1"
        alias="Owner"/>
    <field name="PROP_ADDCO"
        alias="Address"/>
    
   </fields>
   <zoomscale>4800</zoomscale>
   <forcescale>true</forcescale>
  </layer>
  <!--layer>
   <name>Parcels (1200 & 600 Scale)</name>
   <id>47</id>
   <url>http://gis.delhitownship.com/arcgis/rest/services/Public_Website/PW_BaseMap/MapServer</url>
   <fields>
    <field name="PARCELNUM"
        alias="Parcel #"/>
    <field name="OWNER_NAM1"
        alias="Owner"/>
    <field name="PROP_ADDCO"
        alias="Address"/>

   </fields>
   <links>
    <!--link includeinresults="false"
       field="Website"
       alias="View Website"
       tooltip="Click to View Website">
     <linkprefix/>
     <linksuffix/>
     <iconfield/>
     <iconprefix/>
     <iconsuffix/>
    </link-->
   <!--/links>
   <zoomscale>4800</zoomscale>
   <forcescale>true</forcescale>
  </layer-->
  
  


  <!--excludelayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer"
       id="0"/>
  <!-- <excludelayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer" id="2"/> -->
 </layers>

 <symbols>
  <simplefillsymbol color="0x448ccb"
        alpha="0.4"
        style="solid">
   <outline color="0x448ccb"
      alpha="0.8"
      width="2"/>
  </simplefillsymbol>
  <simplemarkersymbol style="circle"
       size="12"
       color="0x448ccb"
       alpha="0.8"
       xoffset="0"
       yoffset="0"
       angle="0">
   <outline style="solid"
      color="0xffffff"
      alpha="0.8"
      width="1"/>
  </simplemarkersymbol>
  <picturemarkersymbol url="assets/images/i_info.png"
        height="30"
        width="30"
        xoffset="0"
        yoffset="0"/>
  <simplelinesymbol color="0x448ccb"
        alpha="0.8"
        width="2"/>
 </symbols>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Darryl,

   Using exactly what you posted (even though there is an error in your commenting you need to work on.) I was able to identify your parcels using my latest version of the identify widget.

[ATTACH=CONFIG]22704[/ATTACH]
0 Kudos
TristanKnowlton
Occasional Contributor II
Well this is a fantastic problem.  Thanks for checking Robert!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Can you start a new site in App builder and add the identify widget and maybe just one of the map services you want to identify as an operational layer and then in the identify widgets config file to this:

<?xml version="1.0"?>
<configuration>
    <identifylayeroption>all</identifylayeroption>
    <identifytolerance>5</identifytolerance>
    <defaultzoomscale>5000</defaultzoomscale>
    <keepidentifyactive>true</keepidentifyactive>
    <returngeometryforzoom>true</returngeometryforzoom>
    <enablelineselect>true</enablelineselect>
    <enableextentselect>true</enableextentselect>
    <enablepolyselect>true</enablepolyselect>
    <enablemouseovergraphicsinfo>false</enablemouseovergraphicsinfo>
    <enablemouseoverrecordinfo>false</enablemouseoverrecordinfo>
    <enablegraphicclickinfo>false</enablegraphicclickinfo>
    <usemaptime>false</usemaptime>
    <infoautoclosemilliseconds>2000</infoautoclosemilliseconds><!-- 2 seconds -->
    <autoactivatedtool>mappoint</autoactivatedtool><!-- possible values are extent or polygon or mappoint or polyline or nothing -->
    <excludebasemaps>false</excludebasemaps>
    <disablepopuplinks>false</disablepopuplinks>
    <disablelayerdropdown>false</disablelayerdropdown>
    <disablealllayerschoice>false</disablealllayerschoice>
    <labels>
        <zoom2message>Click to Zoom to Point</zoom2message>
        <identifylabel>Identify</identifylabel>
        <resultslabel>Results</resultslabel>
        <descriptionlabel>Use the identify tool to identify features on the map:</descriptionlabel>
        <pointlabel>Identify by Point</pointlabel>
        <linelabel>Identify by Polyline</linelabel>
        <rectlabel>Identify by Rectangle</rectlabel>
        <polylabel>Identify by Polygon</polylabel>
        <clearlabel>Clear</clearlabel>
        <loadinglabel>Loading...</loadinglabel>
        <removeresultmessage>Remove Result</removeresultmessage>
        <idfrom>Identify From</idfrom>
        <noresultsfoundlabel>No Results Found</noresultsfoundlabel>
        <resultsfoundlabel>Results Found</resultsfoundlabel>
        <alllayers>All Layers</alllayers>
        <layersremaining>layers remaining:</layersremaining>
    </labels>
    <useproxy/>
    <layers onlythese="false"/>
    <symbols>
        <simplefillsymbol color="0x448ccb"
                          alpha="0.4"
                          style="solid">
            <outline color="0x448ccb"
                     alpha="0.8"
                     width="2"/>
        </simplefillsymbol>
        <simplemarkersymbol style="circle"
                            size="12"
                            color="0x448ccb"
                            alpha="0.8"
                            xoffset="0"
                            yoffset="0"
                            angle="0">
            <outline style="solid"
                     color="0xffffff"
                     alpha="0.8"
                     width="1"/>
        </simplemarkersymbol>
        <picturemarkersymbol url="assets/images/i_info.png"
                             height="30"
                             width="30"
                             xoffset="0"
                             yoffset="0"/>
        <simplelinesymbol color="0x448ccb"
                          alpha="0.8"
                          width="2"/>
    </symbols>
</configuration>
0 Kudos
AndrewIng
New Contributor
Hi Robert,
That code worked. When I use to Identify widget it returns all information for operational and basemap layers. If I set  <excludebasemaps> to true nothing gets returned and if I add my layer information I get an error.
<layer>
            <name>Property</name>
   <id>8</id>
   <url>http://198.167.37.68/arcgis/rest/services/BaseData/MapServer</url>
            <fields>
                <field name="PID" alias="PID"/>
                <field name="FIRSTNAME" alias="FIRSTNAME"/>
                <field name="LASTNAME" alias="LASTNAME"/>
                <field name="PROPLOC" alias="PROPLOC"/>
   </fields>
   <links>
    <link includeinresults="false" field="" alias="" tooltip="">
     <linkprefix></linkprefix>
     <linksuffix></linksuffix>
     <iconfield></iconfield>
     <iconprefix></iconprefix>
     <iconsuffix></iconsuffix>
    </link>
   </links>
   <zoomscale>15000</zoomscale>
   <forcescale>true</forcescale>
        </layer>
0 Kudos