The minimum setup required for a WMS map engine is the capabilities URL for the service.
...
urn:com.cohga.server.map.wms#1.0
Tags
mapengine
Properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | string | yes | Unique identifier | |
url | string | yes | The capabilities URL for the WMS service. You should not include the SERVICE, REQUEST or VERSION parameters in the URL, just use the base URL, these parameters will be added automatically based on the type of request that is being made. Note: WMS version 1.3.0 may be forced on by including the URL VERSION parameter, however, this is not recommended and Weave will use WMS version 1.1.1 by default. | |
format | string | no | first format reported by map engine | Default format that the map engine will request from the WMS server if one is not specified. |
transparent | boolean | no | false | Determines if the areas of the image not covered by spatial data are rendered as transparent or as a solid colour (as set by the background property). Enabling transparency requires an image format that supports it (jpeg and png24 do not). |
background | integer | no | white | The RGB value for the image background if transparency is not enabled |
username | string | no | A username for connecting to the server. | |
password | string | no | A password for connecting to the server. This should be encrypted using 'encrypt' at the osgi prompt. | |
qgis | boolean | no | Force the map engine to be treated as though it were QGIS. Weave will try to determine if the underlying WMS service is provided by QGIS and perform additional optimisations and expose additional capabilities if it is. Sometimes Weave might not be able to determine this correctly, in which case you can set this property to true in the configuration and the map engine will be treated as though it were being served from QGIS. If Weave incorrectly determines that the WMS service is QGIS when it is not, then you can set this property to | |
geoserver | boolean | no | Force the map engine to be treated as though it were GeoServer. Weave will try and determine if the underlying WMS service is provided by GeoServer and perform additional optimisations and expose additional capabilities if it is. Sometimes Weave might not be able to determine this correctly, in which case you can set this property to true in the configuration and the map engine will be treated as though it were being served from GeoServer. If Weave incorrectly determines that the WMS service is GeoServer when it is not, then you can set this property to | |
arcgis | boolean | no | Force the map engine to be treated as though it were ArcGIS. Weave will try and determine if the underlying WMS service is provided by ArcGIS and perform additional optimisations and expose additional capabilities if it is. Sometimes Weave might not be able to determine this correctly, in which case you can set this property to true in the configuration and the map engine will be treated as though it were being served from ArcGIS. If Weave incorrectly determines that the WMS service is ArcGIS when it is not, then you can set this property to | |
arcims | boolean | no | For those still using ArcIMS I'm sure you can figure out what this property does by reading the three properties before this one | |
disableTests | boolean | no | false | Set to true to disable the background checks to validate WMS connections |
testInterval | integer | no | 60,000 | Milliseconds between tests when the WMS connection is working (minimum 15,000) |
testIntervalWhileFailing | integer | no | 15,000 | Milliseconds between tests when the WMS connection is failing (minimum 5,000) |
testFailingDuration | integer | no | 300,000 | How long before a failing WMS connection is determined to have failed (minimum 60,000) |
testIntervalWhenFailed | integer | no | 600,000 | Milliseconds between tests when the WMS connection has failed (minimum 120,000) |
cql | boolean | no | false | Set to true if the map engine supports filtering using CQL. If the map engine is one that is not directly supported by Weave but does support using CQL to filter layers then setting this to true will enable the support for layer filtering using CQL. |
cqlparamname | string | no | cql_filter | The name of the parameter to add to the request URL if CQL filtering support was enabled by setting cql to true |
cqlseparator | string | no | ; | The filter separator to add to the request if CQL filtering support was enabled by setting cql to true |
Sub-tags
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 | #crs | 0..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 |
tokens | #tokens | 0..1 | Additional tokens to add to the request. The tokens available are dependent on the WMS server implementation and are generally used to support implementation specific extensions to the WMS specification. |
legend | #legend | 0..1 | Modify the legend. Available from 2.6.9. |
layers
Sub-tags
Name | Type | Cardinality |
---|---|---|
layer | #layer | 0..n |
remove | #remove | 0..1 |
Info |
---|
You should include one |
remove
Sub-tags
Name | Type | Cardinality |
---|---|---|
layer | #layer | 1..n |
sort
Properties
Name | Type | Required | Description |
---|---|---|---|
method | "firsttolast" or "lasttofirst" | no | Default is |
Sub-tags
Name | Type | Cardinality |
---|---|---|
layer | #layer | 2..n |
layer
Content
The id of the layer
...
styles
Properties
None.
Sub-tags
Name | Type | Cardinality |
---|---|---|
style | #style | 1..n |
style
Properties
Name | Type | Required | Description |
---|---|---|---|
layer | string | yes | The id of the layer, from the map engine, to override the style for |
name | string | yes | The name of the style to use |
crs
Properties
Name | Type | Required | Description |
---|---|---|---|
force | boolean | no | Ensure the CRS is added to the list of available CRSs even if the underlying server doesn't indicate that it supports the EPSG code |
Content
The EPSG code of the coordinate reference system to add
...
Tokens provide a way for the administrator to include additional parameters in the URL sent to the WMS server
Properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
tokenJoinDelimiter | string | no | ; | 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
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | string | yes | The name of the token | |
value | string | yes | The value of the token | |
legendOnly | boolean | no | false if layer is empty true if layer is not empty | Should this token only be applied to requests that are generating a legend |
layer | string | no | 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 | |
prefix | string | no | Value to be prepended to the token value, since 2.6.7 | |
infix | string | no | or | Value to be used to join multiple user attributes, since 2.6.7 |
suffix | string | no | Value to be appended to the token value, since 2.6.7 | |
default | string | no | Value to be used if user attribute substitution does not provide a value, since 2.6.7 |
legend
Properties
Sub-tags
Name | Type | Cardinality |
---|---|---|
remove | #remove | 0..1 |
aliases | #aliases | 0..1 |
aliases
List the new labels to be displayed for a layer
Properties
None
Sub-tags
Name | Type | Cardinality |
alias | #alias | 1..n |
Content
None
alias
A single label change for a layer
Properties
Name | Type | Required | Description |
id | string | yes | The id of the layer to change. Note if a match is not found for the id the label of the layer will be then be searched for. |
label | string | yes | The new label to display |
Sub-tags
None
Content
None
Examples
...
Filtering layers to only include specific layers
Code Block | ||
---|---|---|
| ||
<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 | ||
language | xml | title |
Filtering layers to remove specific layers
Code Block | ||
---|---|---|
| ||
<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>
|
Sorting layers
Code Block | ||||
---|---|---|---|---|
| ||||
<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 | ||||
language | xml | title |
Sorting layers by moving one layer to the bottom
Code Block | ||
---|---|---|
| ||
<wms:mapengine id="test">
<url>http://server/wms/test</url>
<sort method='lasttofirst'>
<layer>photo</layer>
</sort>
</wms:mapengine>
|
Applying styles
Code Block | ||||
---|---|---|---|---|
| ||||
<wms:mapengine id="test">
<url>http://server/wms/test</url>
<styles>
<style layer="property" name="bw_property"/>
<style layer="road" name="bw_road"/>
</styles>
</wms:mapengine>
|
Adding authentication
Code Block | ||||
---|---|---|---|---|
| ||||
<wms:mapengine id="test">
<url>http://username:password@server/wms/test</url>
</wms:mapengine>
| ||||
Code Block | ||||
language | xml |
Refine the list of supported CRS's for the map engine
Code Block | ||
---|---|---|
| ||
<wms:mapengine id="test"> <url>http://server/wms/test</url> <crs>EPSG:4326</crs> <crs>EPSG:28355</crs> <crs>EPSG:3857</crs> </wms:mapengine> |
Adding tokens
Code Block | ||||
---|---|---|---|---|
| ||||
<wms:mapengine id="test"> <url>http://server/wms/test</url> <tokens> <token name="VIEWPARAMS" value="${user.filter.status}" prefix="STATUS:" infix=","/> <token name="VIEWPARAMS" value="USER:${user.id}"/> <token name="BACKFILL" value="true" legendOnly="true" layer="ward,busroutes"/> <!-- BACKFILL will be true for ward and busroutes --> <token name="BACKFILL" value="false" legendOnly="true"/> <!-- BACKFILL will be false for any other layers --> </tokens> </wms:mapengine> |
Editing legend content
Code Block | ||||
---|---|---|---|---|
| ||||
<wms:mapengine id="test"> <url>http://server/wms/test</url> <legend> <remove> <layer>easetxt</layer> <layer>house_numbers</layer> </remove> <aliases> <alias id="property" label="Properties"/> </aliases> </legend> </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.
Weave disables the use of WMS 1.3.0 when communicating with a WMS server unless it's specifically asked to, which can be done by including a VERSION
parameters in the map engine url
attribute, e.g.
...
Enabling support for WMS 1.3.0
Code Block | ||
---|---|---|
| ||
<wms:mapengine id="test"> <url>http://server/wms/test?VERSION=1.3.0</url> </wms:mapengine> |
This is typically all you need to do to enable support for WMS 1.3.0. It is possible that you may be using a coordinate reference system that requires requests sent to the server to reverse the order of x, y coordinates. It is updated 2.14.16 of the Weave WMS map engine bundle that allows you to tell Weave to change the order of the coordinates when sending requests to the server. This is done by setting swapAxis
to true
in the map engine config, e.g.
...
...
Swapping coordinate order for a WMS map engine
Code Block | ||
---|---|---|
| ||
<wms:mapengine id="test"> <url>http://server/wms/test?VERSION=1.3.0</url> <swapAxis>true</swapAxis> </wms:mapengine> |
...
The format with the API key set as a query parameter will not work with Weave, you have to use the format where the API key is provided as part of the URL path as shown below.
...
Required format for Metromap URL
Code Block |
---|
https://api.metromap.com.au/api-link/{YOUR_API_KEY}/wms |
...