0

I would like to add a link to open an image and a PDF file in a new tab from an infowindow. Actually, I can open websites from them but not images or PDF files.

For images, I have uploaded them to Imgur and I have tried with the share and direct link but they don't work.....

For PDFs this doesn't work either. I have my file into dropbox (I only know the download link). Where can I upload it in order to show or download it?

Code for the image:

<p>
 <a  style="color:red">
   <b style="color:blue;font-family:Comic Sans MS ;font-size:150%" 
     <a href="http://imgur.com/E5LWX1U">
       <img src="http://i.imgur.com/E5LWX1U.jpg" title="source: imgur.com target="_blank" />
     </a>> Link vacio
   </a>
  </b>
 </p>   

The PDF file dropbox link: https://www.dropbox.com/s/pvfymix6sw9ydut/fce_hb_dec08.pdf?dl=0

0

How is the code of your infowindow? I've just created this map. Click on any point to see a IW that provides a link.

Full code for the IW here, but this is line to add the image link

  <p><a href="http://160521-mappingsax.s3-website-eu-west-1.amazonaws.com/MappingSax/{{sourcefile}}">Foto</a></p>

See that {{sourcefile}} is a field of my query with the final part of the URL and that I've uploaded my images to Amazon S3. It will work with any link you are able to build.

If your web service provides direct links to the images using HTTPS, then you can use the Image Header style where your image will show up right on the IW. That won't work for PDFs of course.

  • Thanks Jorge! I´ll try again and if I solve it I´ll explain. Juanjo – geodesman May 23 '16 at 11:43
  • Hi! Finally I´ve solved the problem adding my link into a new window: <p><a href="{{image_url}}" target="_blank" >Imagen</a></p> , where {{image_url}} is the field which contains the image direct link. Thank you!! – geodesman May 24 '16 at 18:20
  • then mark the answer as valid :) – Jorge Sanz May 26 '16 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.