Package org.mapfish.print.map.geotools
Class AbstractFeatureSourceLayer
- java.lang.Object
-
- org.mapfish.print.map.geotools.AbstractGeotoolsLayer
-
- org.mapfish.print.map.geotools.AbstractFeatureSourceLayer
-
- All Implemented Interfaces:
MapLayer
- Direct Known Subclasses:
FeatureLayer
,GeoJsonLayer
,GmlLayer
public abstract class AbstractFeatureSourceLayer extends AbstractGeotoolsLayer
A layer that wraps a Geotools Feature Source and a style object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapfish.print.attribute.map.MapLayer
MapLayer.RenderType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractFeatureSourceLayer(java.util.concurrent.ExecutorService executorService, FeatureSourceSupplier featureSourceSupplier, StyleSupplier<org.geotools.api.data.FeatureSource> styleSupplier, boolean renderAsSvg, AbstractLayerParams params)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.geotools.api.data.FeatureSource<?,?>
getFeatureSource(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext)
Get the feature source (either load from the supplier or return the cached source).double
getImageBufferScaling()
Get the scale ratio between the tiles resolution and the target resolution.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.MapLayer.RenderType
getRenderType()
Specify whether layer should be rendered as PNG, JPEG or SVG.void
setFeatureCollection(org.geotools.data.simple.SimpleFeatureCollection featureCollection)
void
setStyle(StyleSupplier style)
-
Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, prefetchResources, prepareRender, render, supportsNativeRotation, tryAddLayer
-
-
-
-
Constructor Detail
-
AbstractFeatureSourceLayer
protected AbstractFeatureSourceLayer(java.util.concurrent.ExecutorService executorService, FeatureSourceSupplier featureSourceSupplier, StyleSupplier<org.geotools.api.data.FeatureSource> styleSupplier, boolean renderAsSvg, AbstractLayerParams params)
Constructor.- Parameters:
executorService
- the thread pool for doing the rendering.featureSourceSupplier
- a function that creates the feature source. This will only be called once.styleSupplier
- a function that creates the style for styling the features. This will only be called once.renderAsSvg
- is the layer rendered as SVG?params
- the parameters for this layer
-
-
Method Detail
-
setStyle
public final void setStyle(StyleSupplier style)
-
getFeatureSource
public final org.geotools.api.data.FeatureSource<?,?> getFeatureSource(@Nonnull MfClientHttpRequestFactory httpRequestFactory, @Nonnull MapfishMapContext mapContext)
Get the feature source (either load from the supplier or return the cached source).- Parameters:
httpRequestFactory
- The factory for making http requests.mapContext
- The map context.
-
getLayers
public final java.util.List<? extends org.geotools.map.Layer> getLayers(@Nonnull MfClientHttpRequestFactory httpRequestFactory, @Nonnull MapfishMapContext mapContext, @Nonnull 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
-
setFeatureCollection
public final void setFeatureCollection(org.geotools.data.simple.SimpleFeatureCollection featureCollection)
-
getRenderType
public final MapLayer.RenderType getRenderType()
Description copied from interface:MapLayer
Specify whether layer should be rendered as PNG, JPEG or SVG.- Returns:
- render type
-
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.
-
-