Identify Widget for FlexViewer 2.1

46042
266
09-23-2010 11:34 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I have been waiting for the Final release of the FlexViewer 2.1 before I started to push out some widgets I have been working on.

Here is my Identify Widget for Flex Viewer 2.1. I have tested to ensure proper functioning with FlexViewer 2.1 and am now releasing it to you since the API Team did not get one into the FlexViewer.

Here is the link:

http://www.arcgis.com/home/item.html?id=39cf66d58c234279ba728c50461a1a89

More FlexViewer 2.1 widgets to come stay tuned...
Tags (2)
0 Kudos
266 Replies
RobertScheitlin__GISP
MVP Emeritus
Eric,

   I realize what you issue is. You are trying to use a UNC path
<iconprefix>\\xxx\xxx\xx\Photos\</iconprefix>

The client machine has no idea how to get to that. You need to use a http url instead
like this
<layer>
   <name>Weather Observations</name>
   <fields>Icon_used,URL,Type,OBJECTID</fields>
   <linkfield>URL</linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield>Icon_used</iconfield>
   <iconprefix>http://gislap134/FlexViewer2.2/assets/images/i_</iconprefix>
   <iconsuffix>.png</iconsuffix>
   <zoomscale>15000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
0 Kudos
DavidRasmussen
New Contributor
Hi Robert,

Is there a way to use this widget for multiple hyperlinks?
I am new to Flex and am using the sample test viewer as my starting point. 
I haven't begun to dig into Flex Developer yet.

Thanks in advance for any direction you can provide,

Regards,
Dave
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   Currently no there is no support for multiple hyperlinks. Mid month there will be an option available that does support multiple hyperlinks though. It is quite different than this widget.

Take a look here:

http://forums.arcgis.com/threads/20281-Preview-of-two-great-new-widgets-coming-out-mid-January-2011
0 Kudos
DavidRasmussen
New Contributor
Dave,

   Currently no there is no support for multiple hyperlinks. Mid month there will be an option available that does support multiple hyperlinks though. It is quite different than this widget.

Take a look here:

http://forums.arcgis.com/threads/20281-Preview-of-two-great-new-widgets-coming-out-mid-January-2011


Those look fantastic!  Is the new InfoTemplate compatible with Flex 2.1 or is it strictly 2.2?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   Hmmm. I haven't tried against 2.1 yet but I think It should be OK.
0 Kudos
DavidAllen
Occasional Contributor
No - I'm not seeing the hyperlink alias. I'm in the identify tool, not the datagrid. My next map will be using the datagrid, so I'll see how that works.


David,

Version 2.2 is the latest is that the one you are using? Also you are talking about the link in the datagrid right?
0 Kudos
ericmonshaugen
New Contributor
Eric,

   I realize what you issue is. You are trying to use a UNC path
<iconprefix>\\xxx\xxx\xx\Photos\</iconprefix>

The client machine has no idea how to get to that. You need to use a http url instead
like this
<layer>
   <name>Weather Observations</name>
   <fields>Icon_used,URL,Type,OBJECTID</fields>
   <linkfield>URL</linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield>Icon_used</iconfield>
   <iconprefix>http://gislap134/FlexViewer2.2/assets/images/i_</iconprefix>
   <iconsuffix>.png</iconsuffix>
   <zoomscale>15000</zoomscale>
   <forcescale>true</forcescale>
  </layer>


Robert,

Thank you! That WAS my problem, it works like a charm now!

Thank you for being so generous with your time and helping all of us out, it is VERY much appreciated!

-Eric
0 Kudos
DavidAllen
Occasional Contributor
David,

    Can you provide me with a screen shot of what you are wanting aliased? I think want you are asking for is not actually part of this widget but I need to be sure.


Sure - shown here is the identify window. This is a sewer map, so I have a hyperlink to the plan. In the popup, it shows the path to the tiff image. It would be better if this said "Click here to see the plan". I've also got a field that hold the path to the profile, but I can ony build one hyperlink.

David
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
David,

   that is what I was afraid of... The info popup that you want to have the alias for is not part of the identifyWidget code it is part of the FlexViewer base code.
0 Kudos
StephenHodge
New Contributor
I can confirm that the hyperlinkalias tag is not present in the 2.2 xml. It would be extremely helpful if either in the readme or a comment in the xml contained guidance on what each tag is for; some of them like <iconprefix> are not immediately apparent to me, and there are some other tricky things (like requiring field alias to be used rather than field name) that would be great to document.

I also notice that in your examples you do have spaces after each field although you mention they shouldn't be there.

One last question: I have gotten this to work for all of my layers/fields except one case. I have a map service where several fields come from a joined table (http://maps.tnc.org/ecadpubprod-anon/rest/services/conservation_projects_anon_WM/MapServer/1), and the fields that have an alias with an "_" character aren't coming through. I have other layers with fields that have an underscore in the alias, and the fields in this layer that don't have underscores in the alias work fine. Is that a possible limitation of the code? I've triple-checked I have the exact alias name in my xml file.

This is a great widget, and will be incredibly helpful to The Nature Conservancy, thanks for submitting!

I'm pasting in the contents of the 2.2 IdentifyWidget.xml so you can confirm whether or not it's what it should be:

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
    // Version 2.2 - Dec. 17, 2010
    //
    ///////////////////////////////////////////////////////////////////////////////
-->
<configuration>
<identifylayeroption>visible</identifylayeroption>
<identifytolerance>5</identifytolerance>
<defaultzoomscale>5000</defaultzoomscale>
<keepidentifyactive>true</keepidentifyactive>
<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</pointlabel>
  <clearlabel>Clear</clearlabel>
  <loadinglabel>Loading...</loadinglabel>
  <selectionlabel>Features Identified:</selectionlabel>
</labels>
<useproxy>
  <proxylayer>
   <!--name>Imagery</name-->
  </proxylayer>
</useproxy>
<layers onlythese="false">
  <layer>
   <name>Zoning</name>
   <fields>ZONING_NAME, ZONING_TYPE</fields>
   <linkfield></linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
   <zoomscale>15000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
  <layer>
   <name>LandUse</name>
   <fields>LANDUSE_NAME</fields>
   <linkfield></linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
   <zoomscale>15000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
  <layer>
   <name>Parcels</name>
   <fields>PARCELID</fields>
   <linkfield></linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
   <zoomscale>12000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
  <layer>
   <name>TrafficCams</name>
   <fields>ONLINE, DESCRIPTION, LAST_UPDATED, URL</fields>
   <linkfield>URL</linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
   <zoomscale>2000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
  <layer>
   <name>PoliceStations</name>
   <fields>PD_NAME, ADDRESS</fields>
   <linkfield></linkfield>
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
   <zoomscale>2000</zoomscale>
   <forcescale>true</forcescale>
  </layer>
</layers>
<info>widgets/InfoTemplates/InfoPopupWidget.swf</info>
</configuration>


I cant seem to get to the fields in my joined (or related) table to show up.  Not sure I have the syntax correct. 

Do you have to have two layer blocks, one for the master layer and one for the joined layer? 

Or do you need to qualify the field names with which table they are coming from. (Doesnt look like you did this, but it would make sense if you needed to.)

Or is there somewhere in the .xml file where I need to do something to activate that relationship.

Just to be clear, the "_" in the field name only seem to be a problem with the alias and link field.  if you just have an alias field with an "_" in it and you want to simply display it, then it works fine.

thanks in advance
Stephen
0 Kudos