Package org.mapfish.print.map.tiled
Class AbstractWMXLayerParams
- java.lang.Object
-
- org.mapfish.print.map.AbstractLayerParams
-
- org.mapfish.print.map.tiled.AbstractTiledLayerParams
-
- org.mapfish.print.map.tiled.AbstractWMXLayerParams
-
- Direct Known Subclasses:
WmsLayerParam
,WMTSLayerParam
public abstract class AbstractWMXLayerParams extends AbstractTiledLayerParams
An abstract layers params class for WM* layers (e.g. WMS or WMTS).
-
-
Field Summary
Fields Modifier and Type Field Description PObject
customParams
Custom query parameters to use when making http requests.PJsonObject
mergeableParams
Custom query parameters that can be merged if multiple layers are merged together into a single request.-
Fields inherited from class org.mapfish.print.map.tiled.AbstractTiledLayerParams
rasterStyle
-
Fields inherited from class org.mapfish.print.map.AbstractLayerParams
failOnError, name, opacity
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWMXLayerParams()
Constructor.protected
AbstractWMXLayerParams(AbstractWMXLayerParams other)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
createCommonUrl()
Create a URL that is common to all image requests for this layer.com.google.common.collect.Multimap<java.lang.String,java.lang.String>
getCustomParams()
Read thecustomParams
into a Multimap.com.google.common.collect.Multimap<java.lang.String,java.lang.String>
getMergeableParams()
Read themergeableParams
into a Multimap.void
setCustomParam(java.lang.String name, java.lang.String value)
Set a custom parameter.boolean
validateBaseUrl()
Validates the provided base url.-
Methods inherited from class org.mapfish.print.map.tiled.AbstractTiledLayerParams
getBaseUrl
-
-
-
-
Field Detail
-
customParams
public PObject customParams
Custom query parameters to use when making http requests. These are related tomergeableParams
except they are the parameters that will prevent two layers from the same server from being merged into a single request with both layers. SeemergeableParams
for a more detailed example of the difference betweenmergeableParams
andcustomParams
.The json should look something like:
{ "param1Name": "value", "param2Name": ["value1", "value2"] }
-
mergeableParams
public PJsonObject mergeableParams
Custom query parameters that can be merged if multiple layers are merged together into a single request.The json should look something like:
For example in WMS the style parameter can be merged. If there are several wms layers that can be merged except they have different style parameters they can be merged because the style parameter can be merged.{ "param1Name": "value", "param2Name": ["value1", "value2"] }
Compare that to DPI parameter (for QGIS wms mapserver). if two layers have different DPI then the layers cannot be merged. In this case the DPI should NOT be one of the
mergeableParams
it should be one of thecustomParams
.
-
-
Constructor Detail
-
AbstractWMXLayerParams
protected AbstractWMXLayerParams()
Constructor.
-
AbstractWMXLayerParams
protected AbstractWMXLayerParams(AbstractWMXLayerParams other)
Copy constructor.- Parameters:
other
- the object to copy
-
-
Method Detail
-
getCustomParams
public final com.google.common.collect.Multimap<java.lang.String,java.lang.String> getCustomParams()
Read thecustomParams
into a Multimap.
-
getMergeableParams
public final com.google.common.collect.Multimap<java.lang.String,java.lang.String> getMergeableParams()
Read themergeableParams
into a Multimap.
-
createCommonUrl
public java.lang.String createCommonUrl() throws java.net.URISyntaxException
Description copied from class:AbstractTiledLayerParams
Create a URL that is common to all image requests for this layer. It will take the base url and append all mergeable and custom params to the base url.- Specified by:
createCommonUrl
in classAbstractTiledLayerParams
- Throws:
java.net.URISyntaxException
-
setCustomParam
public final void setCustomParam(java.lang.String name, java.lang.String value)
Set a custom parameter.- Parameters:
name
- the parameter namevalue
- the parameter value
-
validateBaseUrl
public boolean validateBaseUrl()
Description copied from class:AbstractTiledLayerParams
Validates the provided base url.- Specified by:
validateBaseUrl
in classAbstractTiledLayerParams
- Returns:
- True, if the url is valid.
-
-