Maps — django-wms 0.1.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- django-wms 0.1.0 documentation »

# Maps

To create a usable wms map, subclass WmsMap and add WmsLayers to it. The WmsMap class in django-raster represents the MAP directive in the MapServer terminology. WmsMap defines global parameters for a map service endpoint. Only the most important MapServer MAP parameters are implemented in django-wms. The missing parameters still need to be added. The parameters that are currently implemented are listed below.

The WmsMap allone does specifiy global setup, but data has to be added through layers. Each WMS layer that can be accessed through the WmsMap is represented by a WmsLayer subclass. Specify a list of layers classes when creating a WmsLayer subclass. For example

    # In myapp.wmsmap

    from wms.maps import WmsMap
    from myapp.wmslayers import MyFirstLayer, MySecondLayer, MyThirdLayer

    class MyMap(WmsMap):
        layer_classes = [MyFirstLayer, MySecondLayer, MyThirdLayer]

## Map parameters

A list of map parameters that can be specified as class attributes when subclassing WmsMap.

Title

The title of a WMS service endpoint. Defaults to

    title = 'Django-wms service'

SRS

An array of map projections (srid) can be requested through the map. Defaults to

    srs = ['4326', '3086', '3857']

Enable-requests

WMS request types thata are allowed for the map. Defaults to

    enable_requests = ['GetMap', 'GetLegendGraphic', 'GetCapabilities']

Legend size

Size in pixels of rendered icons on legends returned by the GetLegendGraphic request. Defaults to

    legend_size = (20, 20)

## Module docs

Auto-generated part of the module documentation.

class `wms.maps.` `WmsMap`

  Map objects representing mapserver map files.

  Method to setup map object based on the input parameters. The map object represents the mapserver mapfile and is used to render the wms requests.

  `get_layers`()

    Instantiates and returns a list of layers for this map.

  `register_layers`()

    Registers all layer objects into a map object.

  `register_symbolset`()

    Registers a symbol set in the current map

  `symbolset_class`

    alias of `WmsSymbolSet`

### Navigation

- index
- modules |
- next |
- previous |
- django-wms 0.1.0 documentation »