Legend Demo

How to use this demo:
  • Drag to pan, use the mouse wheel to zoom in and out.
  • Use the drop-down list to change the map size.
  • Use the panel controls to show or hide the pan-zoom-controller, zoom in or out or zoom to the maximum scale.
  • Use the legend controls to hide or show the layer, move it up or down or remove it from the current view.


In this demo the Legato map client is configured by two files:

The config.xml file configures a map viewer which includes a panel with map controls (panning, zooming etc.), a map size control and a legend control. Layers are loaded by the ExtendedWMCLoader component from a separate viewContext.xml file.

The legend control is configured with a number of plugins. These plugins are applied to each of the layers and create per-layer controls which can toggle the visibility and position of layers or remove them from the map. The name of the layer is also rendered by a legend control plugin.

The viewContext.xml in this example is almost the same as in the Web Map Context demo (you may see it here). However, in this case we've configured three separate layers in the map context instead of one layer which combines three WMS layers.

For more details on the configuration please see the files config.xml and viewContext.xml files.

See the Legend Tutorial for more information.