Viewer with Multiple Layers
![]()
Further notes
Using Legato you can easily add several layers, such as additional line and area layers to the existing layers. The desired layers are listed in the context.xml file. Within the SuperWMCLoader tags in the config.xml you can set properties, such as tiling (yes|no) or map background (yes|no) which will become standard settings for all layers that are part of the context.xml file:
<defaultOptions> <isBaseLayer>false</isBaseLayer> <transparent>true</transparent> <singleTile>true</singleTile> </defaultOptions> </olc:Panel>
If these standard settings should not be applied to specific layers, you can define individual layer properties for each layer in the context.xml within an extension tag. The following excerpt includes the World map background, which consists of three base layers, and specific layers with rivers, roads and borders:
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Bathymetry</Name>
<Title>Bathymetry</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Topography</Name>
<Title>Topography</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Hillshading</Name>
<Title>Hillshading</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Rivers</Name>
<Title>Rivers</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Roads</Name>
<Title>Roads</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
<Layer queryable="0" hidden="0">
<Server service="OGC:WMS" version="1.1.1" title="OGC:WMS">
<OnlineResource xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=WorldMap" />
</Server>
<Name>Borders</Name>
<Title>Borders</Title>
<FormatList>
<Format current="0">image/png</Format>
</FormatList>
</Layer>
In general, a map viewer consists of a map background (BaseLayer) and any number of optional layers (Overlays) which are added to the currently active base layer.
Using the layer attribute 'queryable' you can determine which layers should be queried for the object information.
![]()
powered by disy Informationssysteme GmbH
