Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The minimum setup required for a WMS map engine is the capabilities URL for the service.

...

Name

Type

Cardinality

Description

layers

#layers

0..1

Refine what layers are included in the map description.

sort

#sort

0..1


styles

#style

0..1


crs#crs0..n

Refine what CRSs the map engine lists as being supported, as opposed to including all of them (as there might be thousands of CRSs that the WMS server says that it supports).

Without any crs tags a map engine will report all the projections the WMS server says it supports. By adding one or more crs tag you can refine this list so that the map engine only includes those projections that you're actually interested in using (which helps to improve performance). 

tokens#tokens0..1Additional tokens to add to the request

layers

Sub-tags

Name

Type

Cardinality

layer

#layer

0..n

remove

#remove

0..1

...

The EPSG code of the coordinate reference system to add

Examples

...

titleFiltering layers to only include specific layers

...

tokens

Tokens provide a way for the administrator to include additional parameters in the URL sent to the WMS server

Properties

NameTypeRequiredDefaultDescription
tokenJoinDelimiterstringno;value to use to join multiple tokens with the same name, since 2.6.7

Sub-tags

Name

Type

Cardinality

token

#token

1..n

token

Properties

NameTypeRequiredDefaultDescription
namestringyes
The name of the token
valuestringyes
The value of the token
legendOnlybooleanno

false if layer is empty

true if layer is not empty

Should this token only be applied to requests that are generating a legend
layerstringno
Comma separated list of layer id's for which this token should be included, can be used to further restrict when the token is sent, and allows for different tokens to be sent for different layers. Only applies if legendOnly is true
prefixstringno
Value to be prepended to the token value, since 2.6.7
infixstringnoorValue to be used to join multiple user attributes, since 2.6.7
suffixstringno
Value to be appended to the token value, since 2.6.7
defaultstringno
Value to be used if user attribute substitution does not provide a value, since 2.6.7

Examples

Code Block
languagexml
titleFiltering layers to only include specific layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <layers>
    <layer>point1</layer>
    <layer>point2</layer>
    <layer>line1</layer>
    <layer>line2</layer>
    <layer>polygon1</layer>
    <layer>polygon2</layer>
  </layers>
</wms:mapengine>


Code Block
languagexml
titleFiltering layers to remove specific layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <layers>
    <remove>
      <layer>point2</layer>
      <layer>line2</layer>
      <layer>polygon2</layer>
    </remove>
  </layers>
</wms:mapengine>


Code Block
languagexml
titleSorting layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <sort>
    <layer>point1</layer>
    <layer>point2</layer>
    <layer>line1</layer>
    <layer>line2</layer>
    <layer>polygon1</layer>
    <layer>polygon2</layer>
  </sort>
</wms:mapengine>


Code Block
languagexml
titleSorting layers by moving one layer to the bottom
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <sort method='lasttofirst'>
    <layer>photo</layer>
  </layers>sort>
</wms:mapengine>


Code Block
languagexml
titleFiltering layers to remove specific layersApplying styles
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <layers><styles>
    <remove><style       <layer>point2</layer>layer="property" name="bw_property"/>
    <style  <layer>line2</layer>
      <layer>polygon2</layer>
    </remove>layer="road" name="bw_road"/>
  </layers>styles>
</wms:mapengine>


Code Block
languagexml
titleSorting layersAdding authentication
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <sort>
    <layer>point1</layer>
    <layer>point2</layer>
    <layer>line1</layer>
 
  <layer>line2</layer>
    <layer>polygon1</layer>
    <layer>polygon2</layer>
  </sort><url>http://username:password@server/wms/test</url>
</wms:mapengine>


Code Block
languagetitleSorting layers by moving one layer to the bottomxml
titleRefine the list of supported CRS's for the map engine
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
 url>
<sort method='lasttofirst'>
 <crs>EPSG:4326</crs>
   <layer>photo</layer><crs>EPSG:28355</crs>
  <<crs>EPSG:3857</sort>crs>
</wms:mapengine>


Code Block
languagexml
titleApplying stylesAdding tokens
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <tokens>
  <styles>  <token name="VIEWPARAMS"   <style layer="property" name="bw_propertyvalue="${user.filter.status}" prefix="STATUS:" infix=","/>
    <style<token layername="roadVIEWPARAMS" namevalue="bw_road"/>
  </styles>
</wms:mapengine>
Code Block
titleAdding authentication
<wms:mapengine id="test">
  <url>http://username:password@server/wms/test</url>
</wms:mapengine>
Code Block
titleRefine the list of supported CRS's for the map engine
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <crs>EPSG:4326</crs>
  <crs>EPSG:28355</crs>
  <crs>EPSG:3857</crs>USER:${user.id}"/>
    <token name="RULELABEL" value="false" legendOnly="true"/>
    <token name="RULELABEL" value="true" layer="ward,busroutes"/>
  </tokens>
</wms:mapengine>


Note

As of version 1.3.7 of the WMS bundle, the password can be encrypted using the OSGi encrypt command.

WMS 1.3.0

Don't "upgrade" to WMS 1.3.0 unless you really have to.

Version 2.15.16 of the com.cohga.server.map.wms bundle (released as part of Weave 2.5.21) improves support for WMS 1.3.0 by supporting map services that require their axis order to be swapped.

...