jps services
  • Home Page
  • GIS Training Courses
    • QGIS Training Courses
    • ArcGIS Training Courses
    • MapInfo Pro Training Courses >
      • MapBasic Training Course
  • About
  • Blog

Using HTML code to display features in QGIS

3/5/2016

0 Comments

 
The Display Menu within QGIS is used for specifically creating map tips. A new feature now allows the creation of map tips using HTML code. You can use HTML to create a complex display when hovering the mouse over a feature.

From the top menu choose the View option and then from the drop down menu select the Map Tips option to enable it. Then double click on the layer in which you want to display your HTML code. When the Layers Property dialogue box appears click on the Display option on the left side of the dialogue box. In the Display option you can choose either the Field or HTML radio button. Enable the HTML radio button.
Picture
The following code is an example of how the HTML works:

<b>Name of feature: </b>[% "Name_Dep" %]<br>
<b>Is this District's population greater than 500,000?</b><br>
[%CASE WHEN "Population" >= 500000 THEN 'Yes population over 500,000 ' ELSE 'No population less than 500,000 ' END%]
The <b> ….</b> elements will bold any text within the code. Here Name of Feature will be in bold text. The feature which you wish to have displayed appears in square brackets with % on either side of the feature. The feature from the Attribute Table is also contained with double quotation marks. The <br> HTML code creates a new line.

The CASE WHEN ELSE code enables you to make evaluations such as less than, equal to or more than for example. Obviously, there are many uses for this kind of code. You can either type code directly into the Display option box or you can use the Insert expression... and Insert Field boxes at the bottom of the option box to create your code.
Picture
In the above example hovering the mouse over the map will display the text in bold with features of the case options in normal text.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    Joe Short BSc has been involved with various mapping solutions for over twenty years.  If you are considering implementing a GIS  or have ArcGIS Pro, MapInfo Pro or QGIS training requirements, jps services would be happy to be of assistance to your organisation. 

    Archives

    May 2025
    March 2025
    March 2024
    October 2023
    September 2023
    August 2023
    March 2023
    April 2020
    March 2020
    October 2019
    September 2019
    August 2019
    July 2019
    March 2019
    November 2018
    October 2018
    August 2018
    July 2018
    November 2017
    October 2017
    September 2017
    July 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    May 2016
    February 2016
    September 2015
    August 2015
    April 2015
    February 2015
    November 2014
    October 2014
    July 2014
    June 2014
    May 2014
    March 2014
    February 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    June 2013
    May 2013
    April 2013
    February 2013
    December 2012
    October 2012
    September 2012
    August 2012
    July 2012

    Categories

    All
    Arc Gis
    Arcview
    Autodesk
    Cad
    Gis Training
    Local Government
    Mapbasic
    Mapinfo
    Quantum Gis
    Relational Databases
    Saga Gis

    RSS Feed