Package org.mapfish.print.map.image.wms
Class WmsLayer
java.lang.Object
org.mapfish.print.map.geotools.AbstractGeotoolsLayer
org.mapfish.print.map.image.AbstractSingleImageLayer
org.mapfish.print.map.image.wms.WmsLayer
- All Implemented Interfaces:
MapLayer
Wms layer.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapfish.print.attribute.map.MapLayer
MapLayer.LayerContext, MapLayer.RenderType
-
Field Summary
Fields inherited from class org.mapfish.print.map.image.AbstractSingleImageLayer
configuration, registry
Fields inherited from interface org.mapfish.print.attribute.map.MapLayer
DEFAULT_SCALING
-
Method Summary
Modifier and TypeMethodDescriptionGet the HTTP params.com.codahale.metrics.MetricRegistry
Specify whether layer should be rendered as PNG, JPEG or SVG.protected BufferedImage
loadImage
(MfClientHttpRequestFactory requestFactory, MapfishMapContext transformer) Load the image at the requested size for the provided map bounds.prefetchResources
(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory requestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Cache any needed resources on disk.prepareRender
(MapfishMapContext transformer, MfClientHttpRequestFactory clientHttpRequestFactory) Render the layer to the graphics2D object.boolean
If supported by the WMS server, a parameter "angle" can be set on "customParams" or "mergeableParams".Methods inherited from class org.mapfish.print.map.image.AbstractSingleImageLayer
createErrorImage, fetchImage, getLayers, getStyleSupplier
Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, prepareLayerRendering, render, tryAddLayer
-
Method Details
-
loadImage
protected BufferedImage loadImage(@Nonnull MfClientHttpRequestFactory requestFactory, @Nonnull MapfishMapContext transformer) throws IOException Description copied from class:AbstractSingleImageLayer
Load the image at the requested size for the provided map bounds.- Specified by:
loadImage
in classAbstractSingleImageLayer
- Parameters:
requestFactory
- the factory to use for making http requeststransformer
- object containing map rendering information- Throws:
IOException
-
getParams
Get the HTTP params.- Returns:
- the HTTP params
-
supportsNativeRotation
public boolean supportsNativeRotation()If supported by the WMS server, a parameter "angle" can be set on "customParams" or "mergeableParams". In this case the rotation will be done natively by the WMS.- Specified by:
supportsNativeRotation
in interfaceMapLayer
- Overrides:
supportsNativeRotation
in classAbstractGeotoolsLayer
- Returns:
- True if the layer itself takes care of rotating.
-
getRenderType
Description copied from interface:MapLayer
Specify whether layer should be rendered as PNG, JPEG or SVG.- Returns:
- render type
-
prefetchResources
public MapLayer.LayerContext prefetchResources(@Nonnull HttpRequestFetcher httpRequestFetcher, @Nonnull MfClientHttpRequestFactory requestFactory, @Nonnull MapfishMapContext transformer, @Nonnull Processor.ExecutionContext context, @Nonnull MapLayer.LayerContext layerContext) Description copied from interface:MapLayer
Cache any needed resources on disk.- Specified by:
prefetchResources
in interfaceMapLayer
- Overrides:
prefetchResources
in classAbstractGeotoolsLayer
- Parameters:
httpRequestFetcher
- TODOrequestFactory
- client http request factorytransformer
- transformercontext
- the job IDlayerContext
- the context of this layer- Returns:
- the same layer context or one with updated contextual information
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry() -
getConfiguration
-
prepareRender
public MapLayer.LayerContext prepareRender(MapfishMapContext transformer, MfClientHttpRequestFactory clientHttpRequestFactory) Description copied from interface:MapLayer
Render the layer to the graphics2D object.- Parameters:
transformer
- the map transformer containing the map bounds and size.clientHttpRequestFactory
- the factory to use for making http requests.- Returns:
- the LayerContext for this requested rendering.
-