Class TLspWMSLayerBuilder
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
.
- Since:
- 2015.0
-
Method Summary
Modifier and TypeMethodDescriptionborderFactor
(double aBorderFactor) Sets the surplus border factor value used to request images from the Web Map Server (WMS).build()
Creates a new layer instance.filter
(ILcdDynamicFilter aFilter) Sets a filter that will be used to filter objects to prevent them from being painted by the layer.Sets the icon of the layer.Sets the label of the layer.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) This method is not supported for WMS layers.mapScaleProvider
(ILspMapScaleProvider aMapScaleProvider) Sets the map scale provider of the layer.Sets the model of the layer.static TLspWMSLayerBuilder
Returns a new layer builder with the default settingspaintStrategy
(ELcdWMSPaintStrategy aPaintStrategy) Sets the layer's painting strategy.sldStyle
(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) Sets the SLD feature type style of the layer.styler
(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler used to visualize the image.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Method Details
-
newBuilder
Returns a new layer builder with the default settings- Returns:
- a new layer builder with the default settings.
-
build
Creates a new layer instance.
When
styler
is not called, the created layer exposes anILspCustomizableStyler
with the default styles.- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-
styler
public TLspWMSLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler used to visualize the image. Only theTLspPaintRepresentation#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.- Parameters:
aPaintRepresentationState
- the paint representation.aStyler
- the styler- Returns:
- this builder
-
filter
Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.- Parameters:
aFilter
- the filter- Returns:
- this builder
-
model
Sets the model of the layer.- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a model- Returns:
- this builder
- Throws:
IllegalArgumentException
- if the given model is not a WMS model- See Also:
-
label
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.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
layerType
This method is not supported for WMS layers. The default of
LayerType#EDITABLE
is used.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the layer type- Returns:
- this builder
- Throws:
UnsupportedOperationException
- this method is not supported for WMS layers- See Also:
-
icon
Description copied from class:ALspLayerBuilder
Sets the icon of the layer. The default value isnull
.- Overrides:
icon
in classALspLayerBuilder
- Parameters:
aIcon
- the icon- Returns:
- this builder
- See Also:
-
layerStyle
Description copied from class:ALspLayerBuilder
Set a layer style to be used during the rendering of the layer.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 callingILspLayer.setLayerStyle(TLspLayerStyle)
.- Overrides:
layerStyle
in classALspLayerBuilder
- Parameters:
aLayerStyle
- the layer style. Must not benull
. If you want to set the default layer style, setTLspLayerStyle.newBuilder().build()
- Returns:
- this
- See Also:
-
paintStrategy
Sets the layer's painting strategy.
By default a
ELcdWMSPaintStrategy.TILED
approach is used.- Parameters:
aPaintStrategy
- the paint strategy- Returns:
- the layer builder
-
borderFactor
Sets the surplus border factor value used to request images from the Web Map Server (WMS). This property only makes sense when using the non-tiled WMS paint strategy (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 with10%
in every direction. The total requested image size is then44%
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.
- Parameters:
aBorderFactor
- the surplus border factor value.- Returns:
- the layer builder.
- Since:
- 2018.0
- See Also:
-
mapScaleProvider
Sets the map scale provider of the layer. The map scale provider allows the user to control the scale that is used for the painter, independently of the map scale displayed in the view.
The default value is
null
.- Parameters:
aMapScaleProvider
- the map scale provider.- Returns:
- this builder
- Since:
- 2024.0
-
sldStyle
Sets the SLD feature type style of the layer. The SLD feature type style allows the user to configure client-side scale ranges that determine when the data is visualized. Only the scale ranges of rules that have a raster symbolizer are taken into account.
The default value is
null
, in that case the data is always visible.- Parameters:
aSLDFeatureTypeStyle
- the SLD feature type style.- Returns:
- this builder
- Since:
- 2024.0
-