Saturday, 31 December 2016

maptips - Map tip display text in QGIS 2.16: pictures not showing up anymore!


I've been using the great function of QGIS: "map tips". It allows to include html-formatted text (and pictures) in order to popup a window by hovering features. I use map tips for a very convenient visualization of georeferenced pictures, as I presented once on digital-geography blog



But sadly I cannot make it woking anymore since (?) few weeks, I think since I updated QGIS to 2.16.1 (and later 2.16.2)! I'm always using the same code as before:


[%CONCAT('')%]


(I know it can be written in an other way but this was working before...)


Now the frame popping up but there's just no picture enter image description here Is that a consequence of the map tips improvements of QGIS 2.16? Is there a new syntax I'm missing? Or I might have something going wrong on my comp?


Anyone sharing the issue? Any ... tip?


Note that including an Iframe link works, I tried the code proposed by mbernasocchi answering to the question "How to view a video using map-tip QGIS 2.16" and it works great.


I'm working under Kubuntu 14.04
kdelibs: 4.13.3
Qt: 4.8.6
Core: 4.2.0-42-generic

System: 32 bit



Answer



you need to add the file:// prefix. The most portable way to use this (assuming you have the images in the same folder as the project) currently (tested on QGIS 3.2 - ubuntu) is:



you can also add width="300" and height="300" or so if needed


please note the @project_home this is a QGIS variable that is automatically set on each project thus allowing you to maintain relative paths


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...