Select to view content in your preferred language

Maptip with Image Inside

974
8
03-21-2014 10:36 AM
LauraMiles1
Frequent Contributor
Hi,
I would like a Maptip to popup that contains some text and an image. I have the maptip popping up on hover with the text from the PHOTODATE field, but the image does not show and I'm not sure why. I've tried jpeg, png, and bmp, none work (the images in the FILEPATH field are jpegs). I can't even get an image to show up when not trying to retrieve it from a field value. Any help is greatly appreciated. My code:

<esri:FeatureLayer ID="FeatureLayerResDockPhotos2011"
                                    Url="SOME URL"
                                    Where="1=1"
                                    OutFields="PHOTODATE,FILEPATH">
                        <esri:FeatureLayer.MapTip>
                            <Border Style="{StaticResource menuBorder}">
                                <Border.Effect>
                                    <DropShadowEffect Color="Black" Direction="-45" 
                                      BlurRadius="20" Opacity=".75" />
                                </Border.Effect>
                                <StackPanel Margin="7">
                                    <TextBlock Text="{Binding [PHOTODATE]}" FontWeight="Bold" 
                                      Foreground="White" />
                                    <Image Source="{Binding [FILEPATH]}" Height="150" 
                                      Width="150" />
                                    </StackPanel>
                            </Border>
                        </esri:FeatureLayer.MapTip>
                        <esri:FeatureLayer.Clusterer>
                            <esri:FlareClusterer 
                            FlareBackground="#99FF0000" 
                            FlareForeground="White" 
                            MaximumFlareCount="9" />
                        </esri:FeatureLayer.Clusterer>
                    </esri:FeatureLayer>
0 Kudos
8 Replies
LauraMiles1
Frequent Contributor
I've added the following code for a hyperlink button within the maptip:

<HyperlinkButton  TargetName="_blank" NavigateUri="{Binding [FILEPATH]}">
     <HyperlinkButton.Content>
          <Image Source="{Binding [FILEPATH]}" Width="100" Height="100" />
     </HyperlinkButton.Content>
</HyperlinkButton>


This still isn't showing the image, but it does open the image in a new browser tab when clicked within the 100 x 100px box where the image should be...

Any clues out there?
0 Kudos
AhmedEl-Sisi
Deactivated User
Hi Laura ,
can you post sample path for your [FILEPATH] content/format?

you can check that your image is loading using fiddler or firebug in your browser.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
It might be a problem with the Silverlight URL restrictions,
Please check if you miss something to help you out from here http://msdn.microsoft.com/en-us/library/cc189008%28v=vs.95%29.aspx
For example Image doesn't allow cross scheme access.
0 Kudos
LauraMiles1
Frequent Contributor
Hi cc4ever, my filepaths look something like

\\CORPNAS\ntcorp\StructuresPhotos\001 - UNLICENCED [PID 017-587-166].bmp

These are contained in a text field in the gdb table. It's baffling as clicking on a spot where the photo should be brings up the photo in a new window, indicating there aren't any problems with the paths or anything.

Thanks
0 Kudos
LauraMiles1
Frequent Contributor
Hi Dominique,
I looked through the document you linked and see that there are some restrictions on Images. I don't fully understand all of what the document is saying, and I'm not sure if I have an issue with this. The images are located on a different server that is not a web server but should be accessible by the web map (this is our first time trying the Image class). All the servers are part of our internal network and this web map is on our intranet. I've set up the HyperlinkButton so that clicking the photo opens the full size photo in a new browser window. This part works, it is the Image that isn't populating within the maptip as a preview.

I am able to populate the image tag with a random one I pulled off the internet from UCAYA (http://labs.ucaya.com/ucaya.png)

I'm not understanding why this one works, but mine don't?
Thanks
0 Kudos
AhmedEl-Sisi
Deactivated User
Hi cc4ever, my filepaths look something like

\\CORPNAS\ntcorp\StructuresPhotos\001 - UNLICENCED [PID 017-587-166].bmp

These are contained in a text field in the gdb table. It's baffling as clicking on a spot where the photo should be brings up the photo in a new window, indicating there aren't any problems with the paths or anything.

Thanks


Just Put your Server IP instead of server name and it will work.
http://[Server[/url] IP]/ntcorp/StructuresPhotos/001 - UNLICENCED [PID 017-587-166].bmp
0 Kudos
LauraMiles1
Frequent Contributor
Just Put your Server IP instead of server name and it will work.
http://[Server[/url] IP]/ntcorp/StructuresPhotos/001 - UNLICENCED [PID 017-587-166].bmp


Thank you! I will give this a try.
0 Kudos
LauraMiles1
Frequent Contributor
Finally discovered that the images must have a path that is relative to the .xap file. So we moved all our images to the same server as the website is on and coded all the paths to be relative to the .xap file, and voila! Works.
0 Kudos