cismet / cismap-commons

Java Swing components to build standard based mapping apps.
GNU Lesser General Public License v3.0
6 stars 0 forks source link

Add a mode layer that switches preconfigured layers according to a (e.g. application) mode #62

Closed helllth closed 10 years ago

helllth commented 11 years ago

With this layer it should be possible to assign certain layers to different modes. After initializing the layer with that information the layer can easily be switched by switching the mode.

With this kind of a layer one can avoid the adding and removing of the same layers over and over again.

Think of it as a toggle button group of layers ;-)

The layer is needed in this contract: cismet/wupp#96

helllth commented 11 years ago

Example Configuration:

<Layers>
    <ModeLayer>
        <Mode key="A">
            <WMSServiceLayer name="Stadtplanreihe farbig" title="" visible="true" enabled="true" translucency="1.0" bgColor="0xF0F0F0" imageFormat="image/png" exceptionFormat="application/vnd.ogc.se_xml">
                <capabilities type="OGC" active="false"><![CDATA[http://geoportal.wuppertal.de:8083/deegree/wms?VERSION=1.1.1&SERVICE=WMS&REQUEST=GetCapabilities&]]></capabilities>
                <wmsLayer name="R102:stadtplan2007" title="Stadtplanreihe farbig" enabled="true" style="default" info="false" />
            </WMSServiceLayer>
        </Mode>
        <Mode key="B">
            <WMSServiceLayer name="WebAtlasDE" title="" visible="true" enabled="true" translucency="1.0" bgColor="0xF0F0F0" imageFormat="image/png" exceptionFormat="application/vnd.ogc.se_xml">
                <capabilities type="OGC" active="false"><![CDATA[https://sg.geodatenzentrum.de/wms_webatlasde__60d825c3-a2c2-2133-79c0-48721caab5c3?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0]]></capabilities>
                <wmsLayer name="1" title="WebAtlasDE" enabled="true" style="default" info="false" />
            </WMSServiceLayer>

        </Mode>
    </ModeLayer>
</Layers>

The Mode can then be set with e.g.:

layer.setMode("A");