Package org.mapfish.print.map.tiled
Class AbstractTiledLayer<T extends AbstractTiledLayerParams>
java.lang.Object
org.mapfish.print.map.geotools.AbstractGeotoolsLayer
org.mapfish.print.map.tiled.AbstractTiledLayer<T>
- Type Parameters:
T
- Type of the params supported by this layer.
- All Implemented Interfaces:
MapLayer
- Direct Known Subclasses:
OsmLayer
,TiledWmsLayer
,WMTSLayer
public abstract class AbstractTiledLayer<T extends AbstractTiledLayerParams>
extends AbstractGeotoolsLayer
An abstract class to support implementing layers that consist of Raster tiles which are combined
to compose a single raster to be drawn on the map.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapfish.print.attribute.map.MapLayer
MapLayer.LayerContext, MapLayer.RenderType
-
Field Summary
Fields inherited from interface org.mapfish.print.attribute.map.MapLayer
DEFAULT_SCALING
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTiledLayer
(ForkJoinPool forkJoinPool, StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, T params, com.codahale.metrics.MetricRegistry registry, Configuration configuration) Constructor.protected
AbstractTiledLayer
(AbstractGeotoolsLayer other, StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, com.codahale.metrics.MetricRegistry registry, Configuration configuration) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TileInformation<T>
createTileInformation
(MapBounds bounds, Rectangle paintArea, double dpi) Create the tile information object for the given parameters.protected final List<? extends org.geotools.map.Layer>
getLayers
(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Get theDataStore
object that contains the data for this layer.final MapLayer.LayerContext
prefetchResources
(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Cache any needed resources on disk.final MapLayer.LayerContext
prepareRender
(MapfishMapContext mapContext, MfClientHttpRequestFactory clientHttpRequestFactory) Create the tile information and return its ImageBufferingScaling.Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, prepareLayerRendering, render, supportsNativeRotation, tryAddLayer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.mapfish.print.attribute.map.MapLayer
getRenderType
-
Constructor Details
-
AbstractTiledLayer
protected AbstractTiledLayer(@Nullable ForkJoinPool forkJoinPool, @Nullable StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, @Nonnull T params, @Nullable com.codahale.metrics.MetricRegistry registry, @Nonnull Configuration configuration) Constructor.- Parameters:
forkJoinPool
- the thread pool for doing the rendering.styleSupplier
- strategy for loading the style for this layer.params
- the parameters for this layer.registry
- the metrics registry.configuration
- the configuration.
-
AbstractTiledLayer
protected AbstractTiledLayer(AbstractGeotoolsLayer other, @Nullable StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, @Nullable com.codahale.metrics.MetricRegistry registry, @Nonnull Configuration configuration) Copy constructor.- Parameters:
other
- The source.styleSupplier
- strategy for loading the style for this layer.registry
- the metrics registry.configuration
- the configuration.
-
-
Method Details
-
prepareRender
public final MapLayer.LayerContext prepareRender(MapfishMapContext mapContext, MfClientHttpRequestFactory clientHttpRequestFactory) Create the tile information and return its ImageBufferingScaling.- Parameters:
mapContext
- 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.
-
getLayers
protected final List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Description copied from class:AbstractGeotoolsLayer
Get theDataStore
object that contains the data for this layer.- Specified by:
getLayers
in classAbstractGeotoolsLayer
- Parameters:
httpRequestFactory
- the factory for making http requestsmapContext
- the map transformercontext
- the job IDlayerContext
- the context of this layer
-
createTileInformation
protected abstract TileInformation<T> createTileInformation(MapBounds bounds, Rectangle paintArea, double dpi) Create the tile information object for the given parameters.- Parameters:
bounds
- the map boundspaintArea
- the area to paintdpi
- the DPI to render at
-
prefetchResources
public final MapLayer.LayerContext prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, 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
- TODOclientHttpRequestFactory
- client http request factorytransformer
- transformercontext
- the job IDlayerContext
- the context of this layer- Returns:
- the same layer context or one with updated contextual information
-