Displaying TIF files in PopupContent

624
1
11-22-2021 03:39 PM
RogerAsbury
Occasional Contributor

As part of my ongoing project, I often find a need to use the PopupContent class to present data related to a map feature. Usually, this is either a PDF or via a URL link to a website. However, in my latest task, I've found the data I need to present is stored as TIF images on a network share. If I use the code below, it opens the PopupContent window, but instead of displaying the image, it brings up a download dialog which is not the behavior I was expecting.

filePath = "\\\\server\\Folder\\" + fileName + ".tiff";

var popup = new List<PopupContent>
{
new PopupContent(new Uri(filePath), "TIFF Viewer")
};
 MapView.Active.ShowCustomPopup(popup);

This has worked with other file types, such as PDFs, but not TIFs, so my guess is there's no native support for viewing a TIF in the custom popups. When doing Google searches, I seem to find plenty of info on displaying TIFs as a map layer, but that's not my goal. I just want to display a graphic in a popup. 

Any ideas on how that might be accomplished? 

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
1 Reply
KirkKuykendall1
Occasional Contributor III

I'm guessing since PopupContent uses html, and since html can't display tiff images, there's no easy way.

There might be a hard way though: 

Modify the CustomPopup sample's template.html so that it uses tiff.js which allegedly converts tiff's to png.

 

 

0 Kudos