Legend Graphic for WMS
This post will guide you through adding a legend graphic to your WMS service, provided the service includes one.
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.
WMS Legend for Browser
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.