Web Map Service (WMS)

The below is an example setting for configuring a Web Map Service.

{
    "roads":{
        "type": "WMS",
        "url": "Service URL",
        "projection": "Projection Code",
        "projectionDef": "Projection Definition",
        "units": "m",
        "maxExtent": [Maximum extent],
        "parameters": {
            "layers": ["Layer name"]
        }
    }
}
      

"type":

this value must be set to "WMS"

"url":

This is the base URL for the WMS service. e.g. "http://www.osmgb.org.uk/ogc/wms":

To test this in a browser, enter the base URL followed by "?Service=WMS&REQUEST=GetCapabilities", e.g. if the base URL was "http://www.osmgb.org.uk/ogc/wms" then enter : -http://www.osmgb.org.uk/ogc/wms?REQUEST=GetCapabilities

This should return an XML document describing the capabilities of the service.

Note: Do not include anything after the "?" in the Service URL setting.

"projection":

Refer to Projections page for details.

"projectionDef":

Refer to Projections page for details.

"units":

must be entered as "m", as shown in the example. m = metres.

"maxExtent":

This is the minimum and maximum northings and eastings that the map covers.

It is specified as a comma separated list of coordinates inside the square brackets as follows: Minimum X,Minimum Y,Maximum X,Maximum Y

"parameters":

You can add other parameters to this list in the format "name":"Value". These will be added to the end of the URL that is sent to the WMS service in the format "&NAME=Value".

The following parameters are currently supported (all in lower case):

  • "format":
  • "transparent":
  • "login":
  • "password":
  • "country":
  • "key":
  • "product":
  • "url":
  • "tiled":
  • "resolutions":
  • "tileOrigin":
  • "maxExtent":
  • "layers":
Note: "layers": - You may specify a single layer in this list. Multiple layers are currently not supported.
Note: All parameters are passed in plain text, so be aware of this when passing passwords and other secure information over the network.

Cached WMS

Some WMS services, such as Geoserver, pre-cache data on the assumption that the client will always ask for discrete ranges of data. If this is the case then you may also need to provide other tile-related parameters in the settings, such as the list of "resolutions" and the "tileOrigin" or "maxExtent". Most vendors provide OpenLayers examples of how to access their services, so you can obtain most of the settings you need from these examples.