The Home of GeoMOOSE!

Wiki | Tickets | Live Demos | Download
GeoMOOSE Logo

Table Of Contents

Previous topic

Dynamic Select

Next topic

How To Create Your Own Skin

This Page

How To Add Your Own Layers

Adding a new layer in GeoMOOSE 2 is a two step procedure. The first step is to define how GeoMOOSE should communicate with the layer (whether it is MapServer or a WMS source) and the second step defines the layer in the catalog.

Step 1: Adding a Layer

All requests start with a <map-source> tag with a name and type attribute. The name is the name of the source that will be used with GeoMOOSE. This name does not need to relate to the source that is going to be read. The type attribute determines what type of service will be read. The children of the <map-source> are determined by the type attribute. Currently mapserver and wms types are the two that are supported.

All <map-source> types have <layer> children. <layer> children have only one attribute name. The name attribute for <layer> children reflects the name of the layer in the MapServer Mapfile or the name of the layer served by the WMS Service. Some MapServer mapfiles will have all layers set to “default” in which case there should still be one <layer> entry in the <map-source> with the name of “all.”

A Mapserver Layer

Mapserver Layers need to have the <file> tag filled out specifying the location of the mapfile. This path can be relative to the mapfile_root configuration setting or an absolute path on the file system.

Here is an example of the parcels layer from the default demo:

<map-source name="parcels" type="mapserver">
        <file>./demo/landrecords/parcels.map</file>
        <layer name="all"/>
</map-source>

A WMS Layer

WMS Layers have a <url> child that defines the root URL of the WMS service.

This is an example using the LMIC FSA Photography:

<map-source name="lmic" type="wms" tiled="false">
        <url>http://geoint.lmic.state.mn.us/cgi-bin/wms</url>
        <layer name="fsa"/>
</map-source>

Step 2: Adding the Layer to the Catalog

After defining how to talk to the layer we need to define how to display the layer in the interface.

Layers are defined in the <catalog> section of the mapbook. To add the LMIC FSA photography the <layer> entry would look like this:

<layer title="LMIC 2003 FSA Aerials" src="lmic/fsa" status="on"/>

The individual parts:

  • title= - Sets the title in the mapbook to be displayed
  • src= - This is the layer name, it is a combination of the map-source‘s name combined with the layer‘s name from the definitions above.
  • status= - This determines whether the layer is either on or off by when the map loads. Omitting status= will leave the layer off.