.. _geoserver.basemap.layergroup_create:

Creating a Layer Group
----------------------

A layer group is a grouping of a number of layers with some associated styles. Layer groups allow clients to request a single layer which is actually composed of multiple layers. This is commonly referred to as a base map. This section covers the task of defining a layer group.

#. From the `Welcome page <http://localhost:8080/geoserver>`_ navigate to :menuselection:`Config --> WMS --> Contents`.

   .. figure:: layergroup_create1.jpg

      Viewing the WMS contents page 

#. Scroll to the bottom of the page and click the :guilabel:`Add New Layer-Group` button.

   .. figure:: layergroup_create2.jpg

      Adding a new layer group

#. In the resulting form:

   #. Enter "bayarea" in the :guilabel:`Layer-group Name` field.

   #. Enter "topp:bay_area_coastline,topp:bay_area_roads,topp:bay_area_transit_routes,topp:bay_area_bus_stops" in the :guilabel:`Base Map Layers` field.

   #. Leave the **Base Map Styles** field blank.

      .. note:: Leaving the styles field blank specifies that the default styles for each layer in the group should be used.

   #. Generate the bounding box by clicking the **Generate**  button.

      .. figure:: layergroup_create3.jpg

         Definiting a layer group

#. :guilabel:`Submit`, :guilabel:`Apply`, and :guilabel:`Save` changes.

At this point the layer grouping for the base map has been defined. In the :ref:`next <geoserver.basemap.basemap_preview>` section the base map will be previewed with the map preview.
