Select to view content in your preferred language

Image and Links in Pop-ups Help

8465
44
05-17-2011 08:49 AM
EmilyLaMunyon
Deactivated User
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
MehulChoksey
Esri Contributor
try removing extra curly braces in medias tag:

<medias>
  <media  type="image"  imagesource="http://website/flexviewer_weeds/weed_pics/{Name}.jpg"  imagelink="http://website/flexviewer_weeds/weed_pics/oxeye_daisy.jpg"/>
</medias>


also if you want to display name:<Name> in the title tag then title tag should be:
<title>name:{Name}</title>
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks for the help, that seemed to do the trick, however, my images are blank using the {Name}.jpg option. This may be obvious, but do the image names need to exactly match those of the REST service name?

Thanks!
0 Kudos
MehulChoksey
Esri Contributor
Basically using field name "Name" in your case in curly braces {Name} ,  substitutes the value of the Name field.

Could you use tool like fiddler/firebug to capture HTTP response and pos it here?
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks, I finally got it to work! One thing I am noticing is that the image does not fill the entire pop-up. Is there a way to specify the specs of the pop-up?

I appreciate your help!
0 Kudos
MehulChoksey
Esri Contributor
Using just the config wont be enough.You will have to work with source code and modify PopupRenderer skin.
0 Kudos
EmilyLaMunyon
Deactivated User
Can I achieve this without the use of Flash Builder or do I need it to chnage the skin?
0 Kudos
MehulChoksey
Esri Contributor
You will have to modify the popup renderer skin and compile the source either using Flash Builder or by using Flex SDK 4.X
0 Kudos
RyanEckdale-Dudley
Emerging Contributor
Is it possible to create link to a url using a field that has a unique url for each feature without displaying the url?  using Pop-ups
0 Kudos
MehulChoksey
Esri Contributor
Is it possible to create link to a url using a field that has a unique url for each feature without displaying the url?  using Pop-ups

Could you explain bit more? may be with example...
0 Kudos