<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--

    Legato is a configurable, lightweight web mapping client that can be
    easily embedded into web pages and portals, CMS and individual web
    applications. Legato is implemented in JavaScript and based on the
    popular open source library OpenLayers.

    Copyright (C) 2010  disy Informationssysteme GmbH, http://www.disy.net

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

-->

<lb:beans
  xmlns:lb="http://www.disy.net/legato/beans"
  xmlns:ol="http://www.openlayers.org"
  xmlns:oll="http://www.openlayers.org/layer"
  xmlns:olc="http://www.openlayers.org/control"
  xmlns:lf="http://www.disy.net/legato/format"
  xmlns:lc="http://www.disy.net/legato/control"
  xmlns:llp="http://www.disy.net/legato/legend/plugin">

  <!--Map properties-->
  <ol:Map lb:name="map" id="map">            <!--Defining a map name and linking it to the ID of the spaceholder on the html page-->
    <!--Embedding control elements-->
    <controls>
      <olc:Navigation />               <!--Move and zoom in/out-->
      <olc:ScaleLine />              <!--Scale line-->
      <olc:MousePosition />      <!--Display of the mouse position as coordinate-->
      <lc:ArgParser />               <!--URL can be parsed into coordinates-->
      <lb:Reference target="PanZoomBar" />      <!--Display of a zoom bar-->
      <lb:Reference target="NavigationHistory" />  <!--Reference to navigation history for moving to previous or next entry-->
      <lb:Reference target="Panel" />        <!--Creating a panel for further buttons that are listed below-->

      <!--Drop down menu for setting the size of the Viewer-->
      <lc:SetMapSize div="setMapSize">
        <mapSizes>
          <mapSize lb:name="50%">
            <ol:Size w="354" h="354" />
          </mapSize>
          <mapSize lb:name="100%">
            <ol:Size w="500" h="500" />
          </mapSize>
          <mapSize lb:name="150%">
            <ol:Size w="612" h="612" />
          </mapSize>
        </mapSizes>
      </lc:SetMapSize>

      <!--Showing the legend's functionality-->
      <lc:Legend showBaseLayers="true" div="legend">
        <!--
          Specifying the tags on the html page for the legend, the display of the map base in the legend
        -->
        <plugins>
          <llp:LayerVisibility />    <!--Enabling/disabling layer-->
          <llp:LayerPositionUp />    <!--Layer can be moved up-->
          <llp:LayerPositionDown />    <!--Layer can be moved down-->
          <llp:LayerRemove />      <!--Layer can be removed-->
          <llp:LayerZoomToVisibleScale />
          <!--
            zoom layer to a visible scale
          -->
          <llp:LayerName />       <!--Layer name is displayed-->
          <llp:LayerDescription />     <!--Layer symbol is displayed-->
        </plugins>
      </lc:Legend>
    </controls>

    <!--Specifying the map projection-->
    <projection>
      <ol:Projection projCode="EPSG:4326" />
    </projection>
    <!--Specifying the units, e.g. "km" for metre-->
    <units>km</units>
    <!--
      smallest possible scale, e.g. "5000" for 1 : 5000
    <maxScale>8000</maxScale>
    <maxResolution>auto</maxResolution>
    -->
    <fractionalZoom>true</fractionalZoom>
    <!--
      maximum map section defined by two coordinate pairs
    -->
    <maxExtent>
      <ol:Bounds left="-16" bottom="36" right="37" top="63.5" />
    </maxExtent>
  </ol:Map>

  <!--Allowing the user to activate the layer-->
  <lc:LayerSelection>
    <map>
      <lb:Reference target="map" />
    </map>
  </lc:LayerSelection>

  <!--Providing object information-->
  <lc:WMSGetFeatureInfo>
    <infoFormat>text/html</infoFormat>
    <maxFeatures>5</maxFeatures>
    <popupType>MarginAwareFramedCloud</popupType>
    <popupMaxSize>
      <ol:Size w="450" h="200" />
    </popupMaxSize>
    <popupMinSize>
      <ol:Size w="450" h="200" />
    </popupMinSize>
    <popupAutoSize>true</popupAutoSize>
    <popupKeepInMap>false</popupKeepInMap>
  </lc:WMSGetFeatureInfo>

  <!--Defining the panel-->
  <lc:PanZoomBar zoomWorldIcon="true" />  <!--Zoom bar with button allowing the user to return to the original size-->
  <lc:NavigationHistory />       <!--Creating a navigation history for moving to the previous or next entry-->
  <olc:Navigation />            <!--Allowing the user to pan and zoom-->
  <olc:Panel div="panel">
    <defaultControl>
      <lb:Reference target="Navigation" />    <!--Previously activated control element-->
    </defaultControl>
    <controls>
      <lb:Reference target="Navigation" />
      <!--Button for enabling/disabling the zoom bar-->
      <lc:ToggleDisplay>
        <control>
          <lb:Reference target="PanZoomBar" />
        </control>
      </lc:ToggleDisplay>
      <olc:ZoomBox displayClass="olControlZoomInBox" out="false" /> <!--Button for zooming in-->
      <olc:ZoomBox displayClass="olControlZoomOutBox" out="true" /> <!--Button for zooming out-->
      <olc:ZoomToMaxExtent /> <!--Button for zooming to the smallest scale-->
      <lc:NavigationHistoryPrevious>
        <history>
          <lb:Reference target="NavigationHistory" />
        </history>
      </lc:NavigationHistoryPrevious>
      <lc:NavigationHistoryNext>
        <history>
          <lb:Reference target="NavigationHistory" />
        </history>
      </lc:NavigationHistoryNext>
      <!--Button for object query-->
      <lb:Reference target="WMSGetFeatureInfo" />
    </controls>
  </olc:Panel>

  <!--Path to WMC-->
  <lf:SuperWMCLoader url="viewContext.xml"
      createDefaultBaseLayer="true"
    resizeToWindow="true">
    <map>
      <lb:Reference target="map" />
    </map>
    <!--General map settings-->
    <defaultOptions>
      <baseLayer>false</baseLayer>
      <singleTile>true</singleTile>
      <transparent>true</transparent>
    </defaultOptions>
  </lf:SuperWMCLoader>

</lb:beans>