Image and Links in Pop-ups Help

3334
44
05-17-2011 08:49 AM
EmilyLaMunyon
Occasional Contributor
Hello,

I am interested in having an image and/or link appear in my pop-ups in Flexviewer 2.3. I have been successful getting the pop-ups to work, just not with an image or hyperlink. I know I am missing something simple, but does anyone have any insight? Thanks!

PopUp_weeds.xml
?xml version="1.0" ?>
<configuration>
    <title>{name:}</title>
    <fields>
        <field name="Name" alias="Name"
        visible="true"/>
    </fields>
<medias>
  <media  type="image" imagesource="{http://website/flexviewer_weeds/weed_pics/{Name}.jpg}" imagelink="{http://website/flexviewer_weeds/weed_pics/oxeye_daisy.jpg}"/>
</medias>
    <showattachments>true</showattachments>
</configuration>

<!--
    Pop-up configuration file for:
    http://www.gis.slco.org/wwwrest/services/public/Weeds/MapServer/31
-->
config.xml<layer label="Weeds" type="dynamic"  visible="true" alpha="1"
                   url="http://www.gis.slco.org/wwwrest/services/public/Weeds/MapServer">
       <sublayer id="31" popupconfig="popups/PopUp_weeds.xml"/>
       </layer>
Tags (2)
0 Kudos
44 Replies
LarryJahn
Occasional Contributor
I need guidance on a similar issue.  I have a dynamic service sublayer containing many points.  Each point has approximately 10 attributes which need to be hyperlinked in the popup.  Can anyone give me tips on how to best format the popup?

I should also add that my attribute hyperlinks are folder directories which reside on an internal server.
0 Kudos
LarryJahn
Occasional Contributor
I can't get the popus to work at all.  I published an MXD with 3 layers:  point, lines, and polygons.

Below is my config.xml code for the "points (0)" layer placed in the operational layers:

<layer label="Projects" type="dynamic" visible="true"
 url="http://gis.myserver.com/ArcGIS/rest/services/MappedProjects2/MapServer"/>
 <sublayer id = "0" popupconfig="popups/PopUp_Points.xml"/>



Code for my PopUp_Points.xml file:

<?xml version="1.0" ?>
<configuration>
    <title>Project Info</title>
 
    <fields>
        <field name="PROJID"/>
        <field name="MANAGR"/>
        </field>
    </fields>
</configuration>


Is this the right code for popups in a dynamic layer?  Is it considered a "sublayer" in this set of circumstances?  Any help is appreciated.  Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Larry,

   You are making the same mistake as most do. The sublayer element has to be a child of the layer element.

<layer label="Projects" type="dynamic" visible="true" url="http://gis.myserver.com/ArcGIS/rest/services/MappedProjects2/MapServer">
    <sublayer id = "0" popupconfig="popups/PopUp_Points.xml"/>
</layer>
0 Kudos
LarryJahn
Occasional Contributor
Larry,

   You are making the same mistake as most do. The sublayer element has to be a child of the layer element.

<layer label="Projects" type="dynamic" visible="true" url="http://gis.myserver.com/ArcGIS/rest/services/MappedProjects2/MapServer">
    <sublayer id = "0" popupconfig="popups/PopUp_Points.xml"/>
</layer>


Then I guess I don't understand how to make a popup work in a dynamic layer if it's NOT a child of a layer.  Is that possible?  If not, what are the alternatives?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Larry,

  But it IS a child of the parent layer. What I am speaking of is child parent relationships in XML markup. You have a map service that has (sometimes) multiple sub layers and they are given a sequential number starting from 0 to use a popup for one of those sub layers you have to define a sublayer element in the xml file but the way you were doing it the sub layer had not idea that it was a child of the layer because you terminated the layer as shown below:

<layer label="Projects" type="dynamic" visible="true"  url="http://gis.myserver.com/ArcGIS/rest/services/MappedProjects2/MapServer"/>
<sublayer id = "0" popupconfig="popups/PopUp_Points.xml"/>

That slash terminated the layer element and indicated that there was no siblings of the element to come after it so the sublayer was orphaned.
0 Kudos
LarryJahn
Occasional Contributor
I understand now.  What you explained makes complete sense - I just didn't put it all together.  Thanks.
0 Kudos
LarryJahn
Occasional Contributor
Each point has approximately 10 attributes which need to be hyperlinked in the popup. Can anyone give me tips on how to best format the popup?


How do I format the UNC paths in the popup to create a hyperlink?  Thanks.
0 Kudos
LarryJahn
Occasional Contributor
For anyone interested, it IS in fact possible to hyperlink a UNC Path within a popup. It requires a little more configuration, but it does work.

1. You have to use the "<![CDATA[..." <Description> Tag in the popup xml, NOT the <fields> tag
2. You have to make sure the "UNC Path" attribute you are trying to link to follows a format similar to this: \\ServerName\FolderName1\FolderName2\ and so on down the directory structure until you reach the folder you'd like to link to.
3. My description tag format follows this structure (the multiple break tags were added to resemble the tabular field format):

<?xml version="1.0" ?>
<configuration>
    <title>Information</title> 
       
   <description>
 <![CDATA[<b>Project ID:</b> {PROJID}
<br><br><b>Folder:  </b><a href='{FolderUNC}'><u>Folder</u></a>]]>
   </description>

</configuration>
 


It may not be the most efficient way to accomplish UNC hyperlinking, but it's pretty easy nonetheless.
0 Kudos
ScottSnider
New Contributor III
Larry I was able to apply your code to create a link inside my popup based on the UNC.  When I deploy this compiled application to Beta it on our GIS server the links will not open when clicked on.  I can, however, right click and copy the link and paste it into a tab or window and the path opens the correct file.  This behavior exists in IE, Chrome, and Firefox.  I even tried applying my site to trusted sites and it still will not work.  Thoughts?

Scott
0 Kudos
LarryJahn
Occasional Contributor
Scott:
I am using Windows 7/Internet Explorer 8.  I'm not sure if that's the difference or not.  Before I built my Flex Application, I was using the Web Mapping Application Wizard available within ArcServer.  I'm not sure what changed between the Flex application & ArcServer WMA versions, but in the ArcServer WMA version, I had to use the following UNC path format for the hyperlinks to work:

file:///\\servername\folder1\folder2

Maybe give that a shot.  Otherwise, I don't know what else it could possibly be.  Good Luck!
0 Kudos