HTML map tips in QGIS

Published: 05 August 2012

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

http://woostuff.files.wordpress.com/2012/08/html.png

In action

http://woostuff.files.wordpress.com/2012/08/html-inaction.png

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

http://woostuff.files.wordpress.com/2012/08/html-inaction2.png

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 %]

http://woostuff.files.wordpress.com/2012/08/css.png

Happy Mapping :)


Discussion

blog comments powered by Disqus