<?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"
  >

  <!--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 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 the navigation history for moving to the previous or next entry-->
      <lb:Reference target="Panel" />        <!--Creating a panel for further buttons that are listed below-->
    </controls>

    <!--Specifying the map projection-->
    <projection>
      <ol:Projection projCode="EPSG:4326" />
    </projection>
    <!--Specifying the units, e.g. "km" for metre-->
    <units>km</units>

    <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 a 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 a button for zooming to the original size-->
  <lc:NavigationHistory />       <!--Creating a navigation history allowing the user to move 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 allowing the user to view and hide 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 zoooming 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>