New fresh QGIS feature! So fresh in fact you can still smell the wet paint :)
QGIS (development build) can now display map tips using HTML (a subset anyway).
To enable the new map tips: Open the Layer Properties dialog for a layer and select the Display tab
In action
Notice how we can also use a QGIS expression. Anything inside [% %]
will be evaluated and replaced with the value in real-time. We can even use a CASE statement. Pretty cool!
And the result when hovering over a feature
Hold on. Pause the track! We can even use some CSS to make it more fancy.
<style> h1 {color:red;} p.question {color:blue;} </style> <h1> [% "NAME" %] </h1> <br> <img src="[% "image" %]" /> <br> <p class="question">Is this place a country?</p> <br> [% CASE WHEN "TYPE" = 'Country' THEN 'Yes' ELSE 'No. It is a ' || "TYPE" END %]
Happy Mapping :)
fantastic!
That’s awesome. Has there ever been any discussion on having an option to format the identify results with HTML/Javascript?
Reblogged this on Ecostudies and commented:
Pretty cool
[…] out this post by Nathan, where he describes a new QGIS feature! In QGIS (development build) you can now display […]
That’s pretty nice ! Is it possible to make a graph in HTML which read the shapefiles’ values ?
Not really. The support for HTML in map tips is quite limited (it’s more just fancy rich text then true HTML). I am however working on HTML annotations which use QtWebKit which is true html support including the ability to run javascript. Once that is done you can use the values from the feature in some javascript to generate a graph in a annotation.
[…] commando and the other will show images when you just hover the mouse over one feature using the Map Tips tool in QGIS: Berlin is the city for the geo-industry… var disqus_url = […]