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
The parameters for configuration an OSM layer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe URL used for the tile requests.Custom query parameters to use when making http requests.The DPI of the OSM tiles.The image extension.double[]
The maximum extent of the osm layer.Double[]
The allowed resolutions for this layer.double
The amount of difference between a resolution and a target resolution to consider the two equal.int[]
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 -
Method Summary
Modifier and TypeMethodDescriptionconvertToMultiMap
(PObject objectParams) convert a param object to a multimap.Create a URL that is common to all image requests for this layer.Get the base url for all tile requests.Read thecustomParams
into a Multimap.org.locationtech.jts.geom.Envelope
Get the max extent as a envelop object.void
Validate the properties have the correct values.void
setCustomParam
(String name, String value) Set a custom parameter.boolean
Validates the provided base url.
-
Field Details
-
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[] maxExtentThe 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[] tileSizeThe size of each tile. Must have 2 values: width, heightDefault: [256, 256]
-
resolutions
The allowed resolutions for this layer. -
resolutionTolerance
public double resolutionToleranceThe amount of difference between a resolution and a target resolution to consider the two equal. The value is a value from 0-1. -
dpi
The DPI of the OSM tiles. -
imageExtension
The image extension. for example png, jpeg, etc... -
customParams
Custom query parameters to use when making http requests.customParams
.The json should look something like:
{ "param1Name": "value", "param2Name": ["value1", "value2"] }
-
-
Constructor Details
-
OsmLayerParam
public OsmLayerParam()
-
-
Method Details
-
convertToMultiMap
public static com.google.common.collect.Multimap<String,String> convertToMultiMap(PObject objectParams) convert a param object to a multimap.- Parameters:
objectParams
- the parameters to convert.- Returns:
- the corresponding Multimap.
-
getCustomParams
Read thecustomParams
into a Multimap. -
setCustomParam
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
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
-
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.
-