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
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.LayerContext, MapLayer.RenderType -
Field Summary
Fields inherited from interface org.mapfish.print.attribute.map.MapLayer
DEFAULT_SCALING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFeatureSourceLayer(ExecutorService executorService, FeatureSourceSupplier featureSourceSupplier, StyleSupplier<org.geotools.api.data.FeatureSource<?, ?>> styleSupplier, boolean renderAsSvg, AbstractLayerParams params) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.geotools.api.data.FeatureSource<?, ?> getFeatureSource(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext) Get the feature source (either load from the supplier or return the cached source).final List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext mapContext, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Get theDataStoreobject that contains the data for this layer.final MapLayer.RenderTypeSpecify whether layer should be rendered as PNG, JPEG or SVG.final voidsetFeatureCollection(org.geotools.data.simple.SimpleFeatureCollection featureCollection) final voidsetStyle(StyleSupplier<org.geotools.api.data.FeatureSource<?, ?>> style) Methods inherited from class org.mapfish.print.map.geotools.AbstractGeotoolsLayer
getFailOnError, getLayerTransformer, getName, getOpacity, prefetchResources, prepareLayerRendering, render, supportsNativeRotation, tryAddLayerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mapfish.print.attribute.map.MapLayer
prepareRender
-
Constructor Details
-
AbstractFeatureSourceLayer
protected AbstractFeatureSourceLayer(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 Details
-
setStyle
-
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 List<? extends org.geotools.map.Layer> getLayers(@Nonnull MfClientHttpRequestFactory httpRequestFactory, @Nonnull MapfishMapContext mapContext, @Nonnull Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Description copied from class:AbstractGeotoolsLayerGet theDataStoreobject that contains the data for this layer.- Specified by:
getLayersin classAbstractGeotoolsLayer- Parameters:
httpRequestFactory- the factory for making http requestsmapContext- the map transformercontext- the job IDlayerContext- the context of this layer
-
setFeatureCollection
public final void setFeatureCollection(org.geotools.data.simple.SimpleFeatureCollection featureCollection) -
getRenderType
Description copied from interface:MapLayerSpecify whether layer should be rendered as PNG, JPEG or SVG.- Returns:
- render type
-