Select to view content in your preferred language

Adding images from file to pop-ups

7434
18
10-31-2011 11:14 AM
GraemeMcKenzie
Emerging Contributor
Hello Everyone,

I am attempting to add images to the Pop-up windows on a home-made map that is stored in My Content. However, I only seem to be able to use images that are already online somewhere.

Am I wrong in assuming that I can use a file stored on my computer? Do I have to upload them to a website before I can attach them to my shapefile?

Also, is there any way to use difference images for different features? So far I've got the same image attached to every features in the shapefile.

Thanks very much,
Graeme
Tags (2)
0 Kudos
18 Replies
CarolineVallieres
Emerging Contributor
I actually managed to get one image per point (by making a new field in gis desktop) and then I concatenate the fields in the online pop up window. However, now I get an 'X' instead of my image.
(See attachments).
0 Kudos
MikeMinami
Esri Notable Contributor
The concatenation of the field variables must form a valid URL. In your screenshots, it looks like:

Photo1 = PictureA
URL = http://xxx.com/xxx (I assume, though I can't see your URL)

So, when you concatenate these, you put {photo1} in front of the {URL}, thus the concatenation result is:

PictureAhttp://xxx.com/xxx

This is not a valid URL.

If you instead did {URL}{Photo1} it may work. Make sure you have the appropriate forward slash at the end in {URL} to make a valid URL.

URL = http://xxx.com/xxx/ (the ending foward slash would be needed to make a valid URL)
Photo1 = PictureA

Resulting URL:

http://xxx.com/xxx/PictureA

thanks,

Mike
0 Kudos
CarolineVallieres
Emerging Contributor
Thanks Mike - I changed the URL (to flickr) and no longer get an X in the pop-up.  Each point inside the layer is linked to the appropriate image. However, now I simply get a placeholder for where the image should be. What am I doing wrong?
0 Kudos
MikeMinami
Esri Notable Contributor
you will just need to put https in the field value for the URL to your images. It should just work. However, your images must be publicly accessible. If you have to sign in in order to see your images, it may work for you in your own browser, but it won't work for others who view your map.

Thanks,

Mike
0 Kudos
CarolineVallieres
Emerging Contributor
Its a public album and link to Flickr images and the image doesnt appear- only when you click the link 'more info' beside the URL field.
0 Kudos
MikeMinami
Esri Notable Contributor
Sounds like you have the wrong URL to the image. You need a URL like this:

http://www.esri.com/~/media/Images/Content/homepage/features/green.jpg

where the image displays alone on the page. You can't use a URL that points to a Flickr web page, like this:

http://www.flickr.com/photos/belowred/11799423055/in/explore-2014-01-06

The last time I tried to use Flickr, they didn't provide any links on their web pages to get the actual image URL. They also had different sized images for displaying in galleries, etc. In general, I think Flickr wants you to view images on their web page, not embedded elsewhere.

If your URL doesn't go directly to the .jpg image, then it won't work. I think there may be a way to find out the actual URL, but I can't tell you how to do it.

Thanks,

Mike
0 Kudos
CarolineVallieres
Emerging Contributor
�?t works perfectly now. Thank you for all your help 😉
0 Kudos
RaghuMannepalli
Deactivated User
Hello,
I'm wanting to link images to the popups also. Is there anyway to load tiffs onto ArcGIS online my content and then link them to the popups or does it have to come from an outside webpage. I know I'm able to upload the tiff to my content but I want to be able to link that photo directly to a specific feature
Thank You
0 Kudos
MikeMinami
Esri Notable Contributor
Yes, you can display images you upload to My Content in popups. However, I would not suggest the TIFF format, as not all web browsers can display TIFF images (notable exceptions include Chrome and Firefox). You're probably better off with JPG.

http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support

To get the URL to an image in My Content, you need to share the image with everyone first. Once you do so, you'll notice on the item details page a property called Image URL. It will look like this:

http://www.arcgis.com/sharing/rest/content/items/393fc90d7a0246c39e678504589daceb/data

This is the URL to the image. You can add this link when defining an image in a popup.

Now, if you want a unique image for every feature, you will need to have a field (column) in your attributes that lists the ID (the number part above) and you can use the variable substitution to generate the URL. 

Thanks,

Mike
0 Kudos