Select to view content in your preferred language

Info pop-up window is not displaying traffic camera...

944
10
10-13-2010 10:35 AM
ZlatkoGrebenar1
Emerging Contributor
I'm trying to display traffic cameras using the query widget. They display as a link in the widget but when I hover over the different cameras the info pop up window only displays the URL and not the actual traffic camera.

Here is the code for the query widget:
<configuration>
  <name>Traffic Cameras</name>
   <layer>http://******/ArcGIS/rest/services/Development/Traffic_Cams/MapServer/0</layer>
   <query>1=1</query>
   <fields all="false"> <!-- all="false" means it does not get all fields, only the fields specified below -->
        <field name="DESCRIPTIO"/>
        <field name="URL"/>
        </fields>
<linkfield>URL</linkfield>
<refreshrate></refreshrate>
<zoomscale>5000</zoomscale>
    <info>widgets/InfoTemplates/InfoPopupWidget.swf</info>
</configuration>

Thank you,
Tags (2)
0 Kudos
10 Replies
DasaPaddock
Esri Regular Contributor
The InfoPopupWidget only loads the image if the url ends with .jpg, .png or .gif. What are your url's like?
0 Kudos
ZlatkoGrebenar1
Emerging Contributor
The InfoPopupWidget only loads the image if the url ends with .jpg, .png or .gif. What are your url's like?


Here is the link to a traffic camera...
http://www.achdidaho.org/ATIS/CCTV/CCTV_36.jpg?939
0 Kudos
ZlatkoGrebenar1
Emerging Contributor
Here is the link to a traffic camera...
http://www.achdidaho.org/ATIS/CCTV/CCTV_36.jpg?939



I just got it to work all I did is remove the text/numbers after .jpg.


Thanks for your help,
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Zalako,

   Just replace the existing line in the InfoPopup.mxml with one like this

if ((sfx == ".jpg") || (sfx == ".png") || (sfx == ".gif") || link.indexOf(".jpg") > -1)
0 Kudos
RyanKammerer1
Deactivated User
I'm having a similar issue with getting my traffic cam images to show up in the Info Popup window. In my case the URL link being used ends with a .JPEG extension rather than .jpg. Does anyone know of a way around this?

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ryan,

   You can try this line:

if ((sfx == ".jpg") || (sfx == ".png") || (sfx == ".gif") || link.indexOf(".jpg") > -1 || link.indexOf(".jpeg") > -1)
0 Kudos
RyanKammerer1
Deactivated User
Robert,

Thank you for your prompt reply. I have read a lot of your posts, and have tried out several of your widgets, so thank you! You truly are an MVP!
The line of code you suggested needs to replace the existing line in the InfoPopup.mxml. Where exactly is this file? I did a search and I am not sure the InfoPopup.mxml file exists within my flex viewer folder. Has this been eliminated with V2.3? Is it something I need to create? I greatly appreciate any advice.

Thank you,

Ryan
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ryan,

   If you use the popup capabilities in Flex Viewer 2.3.1 than I don't think that the code is needed.

Here is an example of how to use the louisville traffic cameras:

//Main config.xml under operational layers
<layer label="Traffic Cameras" type="feature" visible="true" alpha="1"
                   popupconfig="popups/PopUp_Traffic_Cameras.xml"
                   url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2"/>


//new PopUp_Traffic_Cameras.xml to be added to the popups folder
<?xml version="1.0" ?>
<configuration>
    <title>{DESCRIPTION}</title>     
    <fields>
        <field name="DESCRIPTION"/>                
        <field name="ONLINE"/>       
        <field name="LAST_UPDATED"/>  
        <field name="URL"/>       
    </fields>
    <medias>
        <media type="image" caption="Latest Image {LAST_UPDATED} online: {ONLINE}" imagesource="{URL}" imagelink="{URL}"/>
    </medias> 
</configuration>

<!--
    Pop-up configuration file for:
    http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2
-->
0 Kudos
RyanKammerer1
Deactivated User
Thanks Robert for your help.

I've got everything to work great as far as tweaking the example Louisville Traffic Cam widget to suit our City's needs. I just can't get the traffic cam image to appear in the popup window itself. As posted in the original post by Zlatko, my popup window only displays a link to the image rather than the actual image. Clicking on the link then brings you to the image. I'm assuming this is because all of my traffic cam images end with a .jpeg file extension, rather than the preferred .jpg. Kind of silly but I guess that is where I'm at. I was hoping I could use your code somewhere so that the .jpeg file extension would be recognized. Thanks for your help. I'll keep trying, and post a solution if I find one.

Ryan
0 Kudos