Package org.mapfish.print.map.tiled.osm
Class OsmLayerParam
- java.lang.Object
-
- org.mapfish.print.map.AbstractLayerParams
-
- org.mapfish.print.map.tiled.AbstractTiledLayerParams
-
- org.mapfish.print.map.tiled.osm.OsmLayerParam
-
public final class OsmLayerParam extends AbstractTiledLayerParams
The parameters for configuration an OSM layer.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
baseURL
The URL used for the tile requests.PObject
customParams
Custom query parameters to use when making http requests.java.lang.Double
dpi
The DPI of the OSM tiles.java.lang.String
imageExtension
The image extension.double[]
maxExtent
The maximum extent of the osm layer.java.lang.Double[]
resolutions
The allowed resolutions for this layer.double
resolutionTolerance
The amount of difference between a resolution and a target resolution to consider the two equal.int[]
tileSize
The size of each tile.-
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 Constructor Description OsmLayerParam()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.google.common.collect.Multimap<java.lang.String,java.lang.String>
convertToMultiMap(PObject objectParams)
convert a param object to a multimap.java.lang.String
createCommonUrl()
Create a URL that is common to all image requests for this layer.java.lang.String
getBaseUrl()
Get the base url for all tile requests.com.google.common.collect.Multimap<java.lang.String,java.lang.String>
getCustomParams()
Read thecustomParams
into a Multimap.org.locationtech.jts.geom.Envelope
getMaxExtent()
Get the max extent as a envelop object.java.awt.Dimension
getTileSize()
void
postConstruct()
Validate the properties have the correct values.void
setCustomParam(java.lang.String name, java.lang.String value)
Set a custom parameter.boolean
validateBaseUrl()
Validates the provided base url.
-
-
-
Field Detail
-
baseURL
public java.lang.String baseURL
The URL used for the tile requests.Supported formats:
- The base part of the URL, for example 'http://tile.openstreetmap.org'. This results in an URL like 'http://tile.openstreetmap.org/12/123/456.png'.
- An URL template with the placeholders '{x}', '{y}' or '{-y}', and '{z}'. For example:
'http://tile.openstreetmap.org/{z}/{x}/{y}.png'.
The placeholder '{-y}' provides support for OSGeo TMS tiles.
-
maxExtent
public double[] maxExtent
The maximum extent of the osm layer. Must have 4 coordinates, minX, minY, maxX, maxYDefault: [-20037508.34, -20037508.34, 20037508.34, 20037508.34]
-
tileSize
public int[] tileSize
The size of each tile. Must have 2 values: width, heightDefault: [256, 256]
-
resolutions
public java.lang.Double[] resolutions
The allowed resolutions for this layer.
-
resolutionTolerance
public double resolutionTolerance
The amount of difference between a resolution and a target resolution to consider the two equal. The value is a value from 0-1.
-
dpi
public java.lang.Double dpi
The DPI of the OSM tiles.
-
imageExtension
public java.lang.String imageExtension
The image extension. for example png, jpeg, etc...
-
customParams
public PObject customParams
Custom query parameters to use when making http requests.customParams
.The json should look something like:
{ "param1Name": "value", "param2Name": ["value1", "value2"] }
-
-
Method Detail
-
convertToMultiMap
public static com.google.common.collect.Multimap<java.lang.String,java.lang.String> convertToMultiMap(PObject objectParams)
convert a param object to a multimap.- Parameters:
objectParams
- the parameters to convert.- Returns:
- the corresponding Multimap.
-
getCustomParams
public com.google.common.collect.Multimap<java.lang.String,java.lang.String> getCustomParams()
Read thecustomParams
into a Multimap.
-
setCustomParam
public void setCustomParam(java.lang.String name, java.lang.String value)
Set a custom parameter.- Parameters:
name
- the parameter namevalue
- the parameter value
-
postConstruct
public void postConstruct()
Validate the properties have the correct values.
-
getMaxExtent
public org.locationtech.jts.geom.Envelope getMaxExtent()
Get the max extent as a envelop object.
-
getBaseUrl
public java.lang.String getBaseUrl()
Description copied from class:AbstractTiledLayerParams
Get the base url for all tile requests. For example it might be 'http://server .com/geoserver/gwc/service/wmts'.- Specified by:
getBaseUrl
in classAbstractTiledLayerParams
-
getTileSize
public java.awt.Dimension getTileSize()
-
createCommonUrl
public java.lang.String createCommonUrl()
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
-
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.
-
-