Package org.mapfish.print.map.tiled
Class AbstractTiledLayer
- java.lang.Object
-
- org.mapfish.print.map.geotools.AbstractGeotoolsLayer
-
- org.mapfish.print.map.tiled.AbstractTiledLayer
-
- All Implemented Interfaces:
MapLayer
- Direct Known Subclasses:
OsmLayer
,TiledWmsLayer
,WMTSLayer
public abstract class AbstractTiledLayer 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.RenderType
-
-
Field Summary
Fields Modifier and Type Field Description protected double
imageBufferScaling
The scale ratio between the tiles resolution and the target resolution.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTiledLayer(java.util.concurrent.ForkJoinPool forkJoinPool, StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, AbstractLayerParams 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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TileCacheInformation
createTileInformation(MapBounds bounds, java.awt.Rectangle paintArea, double dpi)
Create the tile cache information object for the given parameters.double
getImageBufferScaling()
Get the scale ratio between the tiles resolution and the target resolution.protected java.util.List<? extends org.geotools.map.Layer>
getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext, Processor.ExecutionContext context)
Get theDataStore
object that contains the data for this layer.void
prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context)
Cache any needed resources on disk.void
prepareRender(MapfishMapContext mapContext, MfClientHttpRequestFactory clientHttpRequestFactory)
Render the layer to the graphics2D object.-
Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, 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 Detail
-
AbstractTiledLayer
protected AbstractTiledLayer(@Nullable java.util.concurrent.ForkJoinPool forkJoinPool, @Nullable StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, @Nonnull AbstractLayerParams 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 Detail
-
prepareRender
public final void prepareRender(MapfishMapContext mapContext, MfClientHttpRequestFactory clientHttpRequestFactory)
Description copied from interface:MapLayer
Render the layer to the graphics2D object.- Specified by:
prepareRender
in interfaceMapLayer
- Overrides:
prepareRender
in classAbstractGeotoolsLayer
- Parameters:
mapContext
- the map transformer containing the map bounds and size.clientHttpRequestFactory
- the factory to use for making http requests.
-
getLayers
protected final java.util.List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext, Processor.ExecutionContext context)
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 ID
-
createTileInformation
protected abstract TileCacheInformation createTileInformation(MapBounds bounds, java.awt.Rectangle paintArea, double dpi)
Create the tile cache information object for the given parameters.- Parameters:
bounds
- the map boundspaintArea
- the area to paintdpi
- the DPI to render at
-
getImageBufferScaling
public final double getImageBufferScaling()
Description copied from interface:MapLayer
Get the scale ratio between the tiles resolution and the target resolution. Used to don't scale the tiles on tiled layer.
-
prefetchResources
public final void prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, 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
- TODOclientHttpRequestFactory
- client http request factorytransformer
- transformercontext
- the job ID
-
-