<?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">
  <ol:Map lb:name="map" id="map">
    <controls>

      <lc:SetMapSize div="mapSizeControl">
        <mapSizes>
          <mapSize lb:name="small">
            <ol:Size w="400" h="200"/>
          </mapSize>
          <mapSize lb:name="medium">
            <ol:Size w="600" h="300"/>
          </mapSize>
          <mapSize lb:name="large">
            <ol:Size w="800" h="400"/>
          </mapSize>
        </mapSizes>
      </lc:SetMapSize>

      <!--
        Here we are referencing the panel control which is defined later on in this configuration.
        References allows avoiding duplicate component definitions. They are also required
        to present the object graph as a tree in XML.
        
        You don't have to take care of the order of definitions, Legato will analyze and process
        them in the correct sequence. Therefore it is fine to reference a control
        before it is configured.
      -->
      <lb:Reference target="Panel" />
      <lb:Reference target="PanZoom" />

    </controls>
  </ol:Map>

  <!--
    These controls are configured here and referenced later by the panel
  -->
  <lc:PanZoom />
  <olc:Navigation/>

  <!--
    This element configures the panel control.
  -->
  <olc:Panel div="panel">
    <!--
      Default control will be activated automatically.
    -->
    <defaultControl>
      <lb:Reference target="Navigation" />
    </defaultControl>
    <controls>
      <!--
        Defines controls which will be added to the panel.
        Changing the order of elements in this configuration will change the order
        of controls in the panel.
      -->
      <lb:Reference target="Navigation" />
      <lc:ToggleDisplay>
        <control>
          <lb:Reference target="PanZoom" />
        </control>
      </lc:ToggleDisplay>
      <lc:Separator />
      <olc:ZoomInBox/>
      <olc:ZoomOutBox/>
      <lc:Separator />
      <olc:ZoomToMaxExtent />
    </controls>
  </olc:Panel>

  <lf:ExtendedWMCLoader
    url="viewContext.xml"
    createDefaultBaseLayer="true">
    <map>
      <lb:Reference target="map" />
    </map>
    <defaultOptions>
      <transparent>true</transparent>
      <isBaseLayer>false</isBaseLayer>
      <singleTile>false</singleTile>
    </defaultOptions>
  </lf:ExtendedWMCLoader>
</lb:beans>