[PRO] Clickable Coloured Legend

You are here:

The plugin includes 2 different approaches to include an interactive legend.

  • Using only one map and the legends can be for the different types of data entries
    (markers, regions, vector icons, text labels);
  • Using multiple overlaid maps where you can filter through the same type of data on different maps.

Using Overlay Maps

The process is not the most direct, but it shouldn’t be very complicated. The important things to consider:

  • Each legend entry will correspond to a different map entry.
  • There should be a ‘parent’ map and then all other maps should be added in the ‘Overlay’ section.
  • For each individual map you can set the markers and regions to display or not in the legend.
  • The colour in the legend will be the ‘default’ colour of the regions or markers.
  • Clicking the legend entries will show/hide the entries from that map.

Consider for example that you want to have a map with markers divided by categories and have a clickable legend to show/hide those different groups of markers. You should have a map for each category and have the markers on the different maps. Then you should create a ‘parent’ map to display the entries from the different maps. Consider the following example:

Click to see more details.

In the example above we have a total of 3 maps. The base map and the map for ‘Cheese’ and ‘Wines’.

[PRO] Clickable Coloured Legend

In the base map we have actually coloured some of the countries and enabled the legend in the ‘Map Features’ section of the map.

[PRO] Clickable Coloured Legend

With this setup you’re able to filter through markers of the different maps, giving the illusion of one full map where markers from different categories can be shown/hidden.

Legend of a unique map

You can also enable the legend of a single map and choose to display coloured legend for the data in your map, divided by the different types:

  • Regions
  • Round Coloured Markers
  • Vector Icons
  • Image Markers
  • Text Labels
  • Lines

This approach is less versitile, since you can’t group markers or regions in different ‘categories’, you would be filtering them all together.

Remember to enable the ‘Show in Legend’ option

For each type of data (regions, markers, etc) you’ll need to enable the option ‘Show in Legend’ for them to display in the legend.

[PRO] Clickable Coloured Legend

Here you can set the title for this data set in the legend also.

And then also enable the actual legend in the Map Features tab.

Posted by Carlos Moreira

Lead developer of Interactive Geo Maps plugin.