Package org.mapfish.print.map.image
Class ImageLayer
- java.lang.Object
-
- org.mapfish.print.map.geotools.AbstractGeotoolsLayer
-
- org.mapfish.print.map.image.AbstractSingleImageLayer
-
- org.mapfish.print.map.image.ImageLayer
-
- All Implemented Interfaces:
MapLayer
public final class ImageLayer extends AbstractSingleImageLayer
Reads a image file from an URL.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageLayer.ImageLayerPlugin
Renders an image as layer.static class
ImageLayer.ImageParam
The parameters for reading an image file, either from the server or from a URL.-
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
ImageLayer(java.util.concurrent.ExecutorService executorService, StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, ImageLayer.ImageParam params, Configuration configuration, com.codahale.metrics.MetricRegistry registry)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getImageBufferScaling()
Get the scale ratio between the tiles resolution and the target resolution.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
prepareRender(MapfishMapContext transformer, MfClientHttpRequestFactory clientHttpRequestFactory)
Render the layer to the graphics2D object.-
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, prefetchResources, render, supportsNativeRotation, tryAddLayer
-
-
-
-
Constructor Detail
-
ImageLayer
protected ImageLayer(@Nonnull java.util.concurrent.ExecutorService executorService, @Nonnull StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier, @Nonnull ImageLayer.ImageParam params, @Nonnull Configuration configuration, @Nonnull com.codahale.metrics.MetricRegistry registry)
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.configuration
- the configuration.registry
- the metrics object.
-
-
Method Detail
-
loadImage
protected java.awt.image.BufferedImage loadImage(MfClientHttpRequestFactory requestFactory, MapfishMapContext transformer)
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
-
getRenderType
public MapLayer.RenderType getRenderType()
Description copied from interface:MapLayer
Specify whether layer should be rendered as PNG, JPEG or SVG.- Returns:
- render type
-
getImageBufferScaling
public 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.- Specified by:
getImageBufferScaling
in interfaceMapLayer
- Overrides:
getImageBufferScaling
in classAbstractSingleImageLayer
-
prepareRender
public void prepareRender(MapfishMapContext transformer, MfClientHttpRequestFactory clientHttpRequestFactory)
Description copied from interface:MapLayer
Render the layer to the graphics2D object.- Specified by:
prepareRender
in interfaceMapLayer
- Overrides:
prepareRender
in classAbstractGeotoolsLayer
- Parameters:
transformer
- the map transformer containing the map bounds and size.clientHttpRequestFactory
- the factory to use for making http requests.
-
-