Skip to main content

Functions (General)

Legend Graphic for WMS

This post will guide you through adding a legend graphic to your WMS service, provided the service includes one.
🧠
Legend graphics in Web Map Services are visual representations that help users understand the meaning of the symbols, colors, or patterns used in the map layers provided by a WMS.

Legends are typically accessed via a specific request to the WMS server. This is done using the GetLegendGraphic request, which is a standard WMS operation defined by the Open Geospatial Consortium (OGC). M.App Enterprise provides the option to integrate these legends into both Browser and Desktop applications.

Add Geoservice

Whether you want to create a Browser or a Desktop app, you first need to add your WMS as Geoservice in M.App Enterprise Studio. More detailed information can be found in the following post.

Different Geoservices in M.App Enterprise
WMS, WMTS, WFS, HERE Maps, Google Maps, ECWP and TMS This tutorial offers assistance in integrating different Geoservices in your M.App Enterprise application. WMS/ WMTS/ WFS Content → Geoservices → New → WMS/WMTS/WFS Web Map Services (WMS), Web Map Tile Services (WMTS) and Web Feature Services (WFS) are added in

WMS Legend for Browser since 16.11

Let's move to your browser application to display the Legend.

When using a geoservice that offers a legend graphic, the graphic will be showcased within the application's layer tree. You can locate the legend under the information icon.

By clicking on this icon, you will see the legends for all selected WMS layers in one separate window.

WMS Legend for Desktop

Lets' have a look how the same legend can be displayed in a Desktop app.

When using a desktop app, the legend can be found in the layer actions.

To access them, right-click on the desired layer, choose Actions and Show legend graphic. The legend will then be shown in a separate closable window.