public final class TLspWMSLayerBuilder extends ALspLayerBuilder
Layer builder for WMS models.
An example of how to use this builder:
ILspLayer layer = TLspWMSLayerBuilder.newBuilder()
.model(myWMSModel)
.build();
The layer can be configured
with different paint strategies.
When using the non-tiled painter strategy
there is an additional
configuration setting margin
that is relevant. The margin
is used to request images from the
WMS that are larger than the view port of the map (image size and area).
On following map re-paints the retrieved WMS image is reused when possible.
This is the case when the proxy configuration is the same and when the area covered and image pixel density
of the image are close enough with the previous request.
This reduces the number of WMS requests when the map is panned slightly.
It is possible to perform a GetFeatureInfo request for WMS layers using TLspWMSGetFeatureInfoContextQuery
.
Modifier and Type | Method and Description |
---|---|
TLspWMSLayerBuilder |
borderFactor(double aBorderFactor)
Sets the surplus border factor value used to request images from the Web Map Server (WMS).
|
ILspInteractivePaintableLayer |
build()
Creates a new layer instance.
|
TLspWMSLayerBuilder |
filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspWMSLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspWMSLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspWMSLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspWMSLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
This method is not supported for WMS layers.
|
TLspWMSLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspWMSLayerBuilder |
newBuilder()
Returns a new layer builder with the default settings
|
TLspWMSLayerBuilder |
paintStrategy(ELcdWMSPaintStrategy aPaintStrategy)
Sets the layer's painting strategy.
|
TLspWMSLayerBuilder |
styler(TLspPaintRepresentationState aPaintRepresentationState,
ILspStyler aStyler)
Sets the styler used to visualize the image.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspWMSLayerBuilder newBuilder()
public ILspInteractivePaintableLayer build()
Creates a new layer instance.
When styler
is not called, the created layer exposes an ILspCustomizableStyler
with the default styles.
build
in class ALspLayerBuilder
public TLspWMSLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
TLspPaintRepresentation#BODY
affects the style of the raster.
Refer to the TLspRasterLayerBuilder class javadoc for an overview of the supported styles.
The default styler drapes the raster data on top of the view's terrain and paints a red hatched rectangle when zoom
out too far.aPaintRepresentationState
- the paint representation.aStyler
- the stylerpublic TLspWMSLayerBuilder filter(ILcdDynamicFilter aFilter)
aFilter
- the filterpublic TLspWMSLayerBuilder model(ILcdModel aModel)
model
in class ALspLayerBuilder
aModel
- a modelIllegalArgumentException
- if the given model is not a WMS modelILcdLayer.getModel()
public TLspWMSLayerBuilder label(String aLabel)
Sets the label of the layer. This is a short textual representation for it, often used to represent the layer to end-users.
The default value is null
. In that case, the display name of the model descriptor is used as label.
label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspWMSLayerBuilder layerType(ILspLayer.LayerType aLayerType)
This method is not supported for WMS layers. The default of LayerType#EDITABLE
is used.
layerType
in class ALspLayerBuilder
aLayerType
- the layer typeUnsupportedOperationException
- this method is not supported for WMS layersILspLayer.getLayerType()
public TLspWMSLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspWMSLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
ALspLayerBuilder
TLspLayerStyle
is used to style the layer as a whole. Layer style can for example modify the
transparency of a layer. Also, layer style can be modified after building the layer by calling
ILspLayer.setLayerStyle(TLspLayerStyle)
.layerStyle
in class ALspLayerBuilder
aLayerStyle
- the layer style. Must not be null
. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
ILspLayer.getLayerStyle()
,
ILspLayer.setLayerStyle(TLspLayerStyle)
public TLspWMSLayerBuilder paintStrategy(ELcdWMSPaintStrategy aPaintStrategy)
Sets the layer's painting strategy.
By default a ELcdWMSPaintStrategy.TILED
approach is used.
aPaintStrategy
- the paint strategypublic TLspWMSLayerBuilder borderFactor(double aBorderFactor)
ELcdWMSPaintStrategy.SINGLE_IMAGE
.
The image dimension based on the view size is extended with this surplus border factor in each direction.
Using a value of 0.1
for example results in extending the image size with 10%
in every direction.
The total requested image size is then 44%
larger than when no surplus border is being used.
This allows to reduce the number of WMS requests for small pan operations on the view and can avoid some empty space on the map while waiting for the WMS response.
Note that the size of the surplus border may be reduced if the requested image size would extend the maximum allowed image size advertised by the WMS.
The default value of the border factor is 0.0.
aBorderFactor
- the surplus border factor value.TLspWMSLayerBuilder()