Select to view content in your preferred language

Hyperlinks for Flex Viewer 3.0

3100
14
Jump to solution
06-03-2012 07:43 AM
TimHayes
Frequent Contributor
I installed the Flex Viewer 3.0. Works great. But, I have 100 digital photos each one is linked to a point in a point feature class. I want the user to be able to click on the point and the photo with some associated data fields will popup in a Flash Window. All of the photos are in one directory on our server, there is a field called "PHOTOS" in the attribute table of the point feature class with the name of each photo, for example, img6543.jpg, img3234.jpg, img7684.jpg associated with each point.

Any suggestions on how to do this?

NOTE: I am not a coder, I know the basics of XML, and prefer to work with compiled widgets.
Tags (2)
0 Kudos
14 Replies
TimHayes
Frequent Contributor
Since you are using the compiled version, it shouldn't be a build project issue.  My first thought would be to clear all the browser cache files, then open in a "new" browser window.

Pressing <cntrl><F5> is supposed to reload without cached pages, so might try that.  However, depends on what flakiness your windows has, this works great on some of my computers, others it just ignores it.  Have not been able to figure out why, but on the ignore box's, one has to clear the cache pages AND start a new browser EVERY time you make a change, or you won't see it.

R_


That did the trick. Thanks! one more quick question, the attribute table where I have my photos stored. The photos are in the HYPERLINK field stored as "http://servername/folder/photo.jpg Does this make a difference or should I have the photo file name only as opposed to the entire URL to the specific photo in one field?
0 Kudos
RhettZufelt
MVP Notable Contributor
That did the trick. Thanks! one more quick question, the attribute table where I have my photos stored. The photos are in the HYPERLINK field stored as "http://servername/folder/photo.jpg Does this make a difference or should I have the photo file name only as opposed to the entire URL to the specific photo in one field?


Mine actually has the subfolder(s)/filename.jpg in the field but Robert made the widget to work either way, and is set up in the individual xml config files. Some of mine have MANY photos, so I ran into field length issues and such trying to code entire paths.

Since I just have the folder/filename in there, I use the linkprefix tag in the xml to add the "http://server/basepath/" Have not tried it, but if you have the full URL in the hyperlink field, then should work if you don't use the linkprefix
<multiimagefield linkprefix="" linksuffix="" nexttooltip="Next" prevtooltip="Prev">HYPERLINK </multiimagefield>
.

Also, he has a linksuffix option as well if you need to append ".jpg" or the like to the path. So, your URL will be the <linkprefix> + <linkfield> + <linksuffix>. Should give you the freedom to set it up as you like.

R_
0 Kudos
TimHayes
Frequent Contributor
I am getting the hang of it. Everything works except for the image to the hyperlink does not show up. I believe this is a UNC path issue internal to our server. I am looking into it. You have been very helpful.
0 Kudos
TimHayes
Frequent Contributor
Mine actually has the subfolder(s)/filename.jpg in the field but Robert made the widget to work either way, and is set up in the individual xml config files. Some of mine have MANY photos, so I ran into field length issues and such trying to code entire paths. 

Since I just have the folder/filename in there, I use the linkprefix tag in the xml to add the "http://server/basepath/" Have not tried it, but if you have the full URL in the hyperlink field, then should work if you don't use the linkprefix  
<multiimagefield linkprefix="" linksuffix="" nexttooltip="Next" prevtooltip="Prev">HYPERLINK </multiimagefield>
.  

Also, he has a linksuffix option as well if you need to append ".jpg" or the like to the path. So, your URL will be the <linkprefix> + <linkfield> + <linksuffix>. Should give you the freedom to set it up as you like. 

R_


I have it working for all I need but one thing. I cannot seem to get the thumbnail of the hyperlinked photo to appear in the popup window, the hyperlink is there, and an empty icon for where the thumbnail should be. I would like the user to be able to preview a thumbnail of the photo and click on it to view a larger photo in a separate tab. All works but no thumbnail preview. NOTE: the links to my photos is a UNC path, not a URL since the files are retrieved locally from our server. Here is the xml file:


<?xml version="1.0" ?>
<configuration>
<fields>GPS_Pt_Loc,Material,Color,Diameter,Depth_Belo,HYPERLINK</fields>
<titlefield>Material</titlefield>
<links>
<linkfield icon_or_text_or_img="img" icon=""
linkalias="" linkprefix="" linksuffix="">HYPERLINK</linkfield>
<linkfield icon_or_text_or_img="text" icon=""
linkalias="Show Image..." linkprefix="" linksuffix="">HYPERLINK</linkfield>
</links>
<multiimagefield linkprefix="" linksuffix="" nexttooltip="Next" prevtooltip="Prev"></multiimagefield>
<layername>Exposed_Pipes_GPS_Test</layername>
<datefields></datefields> <!-- field in milliseconds -->
<zoomscale>2500</zoomscale>
<csvseparator>,</csvseparator>
<labels>
<csvdefaultname>Related Records</csvdefaultname>
<exportbtnlabel>Export...</exportbtnlabel>
<export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>
<export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>
</labels>
</configuration>
0 Kudos
RhettZufelt
MVP Notable Contributor
Couple things that may do it.  I have the linkfield commented out as I am using multiimagefield instead.

Take a look at my xml as it is working fine.  shows the multi images and all the attributes in the <fields> columns.

Also, I have my images referenced by UNC also.  But, I have made a virtual directory (as recommended) in my flex project that "points" to the actual location of the photos.  This helps get rid of any permission issues AND lets you encode the images with a true URL (http://) address.

For Flex project "hanf"

<?xml version="1.0" ?>
<configuration>
 <fields>SIS_ID,OSE_ID,OSE_REPORT,CLASSIFICATION,MRSTEW_DESC,PHOTOS</fields>
 <titlefield>OSE_ID</titlefield>
 <links>
  <!-- <linkfield icon_or_text_or_img="img" icon="" linkalias="Photo" linkprefix="http://gis01.wch-rcc.com/hanf/images/" 
   linksuffix="">PHOTOS</linkfield> -->
 </links>
 <multiimagefield linkprefix="http://gis01.wch-rcc.com/hanf/images/" linksuffix="" nexttooltip="Next" prevtooltip="Prev">PHOTOS</multiimagefield>

 <!-- <datefields>collection_time</datefields> -->
 <zoomscale>50000</zoomscale>
 <csvseparator>,</csvseparator>
 <layername>MR Features</layername>
 <labels>
  <csvdefaultname>Related Records</csvdefaultname>
  <exportbtnlabel>Export...</exportbtnlabel>
  <export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>
  <export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>
 </labels>
</configuration>
0 Kudos