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
public final class WmsLayer extends AbstractSingleImageLayer
Wms layer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapfish.print.attribute.map.MapLayer
MapLayer.RenderType
-
-
Field Summary
-
Fields inherited from class org.mapfish.print.map.image.AbstractSingleImageLayer
configuration, registry
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WmsLayer(java.util.concurrent.ExecutorService executorService, StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, WmsLayerParam params, com.codahale.metrics.MetricRegistry registry, Configuration configuration)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration
getConfiguration()
WmsLayerParam
getParams()
Get the HTTP params.com.codahale.metrics.MetricRegistry
getRegistry()
MapLayer.RenderType
getRenderType()
Specify whether layer should be rendered as PNG, JPEG or SVG.protected java.awt.image.BufferedImage
loadImage(MfClientHttpRequestFactory requestFactory, MapfishMapContext transformer)
Load the image at the requested size for the provided map bounds.void
prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory requestFactory, MapfishMapContext transformer, Processor.ExecutionContext context)
Cache any needed resources on disk.boolean
supportsNativeRotation()
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, getImageBufferScaling, getLayers, getStyleSupplier
-
Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, prepareRender, render, tryAddLayer
-
-
-
-
Constructor Detail
-
WmsLayer
protected WmsLayer(@Nonnull java.util.concurrent.ExecutorService executorService, @Nonnull StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, @Nonnull WmsLayerParam params, @Nonnull com.codahale.metrics.MetricRegistry registry, @Nonnull Configuration configuration)
Constructor.- Parameters:
executorService
- the thread pool for doing the rendering.styleSupplier
- the style to use when drawing the constructed grid coverage on the map.params
- the params from the request data.registry
- the metrics registry.configuration
- the configuration.
-
-
Method Detail
-
loadImage
protected java.awt.image.BufferedImage loadImage(@Nonnull MfClientHttpRequestFactory requestFactory, @Nonnull MapfishMapContext transformer) throws java.io.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:
java.io.IOException
-
getParams
public WmsLayerParam 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
public MapLayer.RenderType getRenderType()
Description copied from interface:MapLayer
Specify whether layer should be rendered as PNG, JPEG or SVG.- Returns:
- render type
-
prefetchResources
public void prefetchResources(@Nonnull HttpRequestFetcher httpRequestFetcher, @Nonnull MfClientHttpRequestFactory requestFactory, @Nonnull MapfishMapContext transformer, @Nonnull Processor.ExecutionContext context)
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 ID
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry()
-
getConfiguration
public Configuration getConfiguration()
-
-