Class TLspWMSLayerBuilder

java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.wms.client.lightspeed.TLspWMSLayerBuilder

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.

Since:
2015.0
  • Method Details

    • newBuilder

      public static TLspWMSLayerBuilder 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 an ILspCustomizableStyler with the default styles.

      Specified by:
      build in class ALspLayerBuilder
      Returns:
      the new layer instance
    • styler

      public TLspWMSLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
      Sets the styler used to visualize the image.

      Only the 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.

      Parameters:
      aPaintRepresentationState - the paint representation.
      aStyler - the styler
      Returns:
      this builder
    • filter

      public TLspWMSLayerBuilder filter(ILcdDynamicFilter aFilter)
      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

      public TLspWMSLayerBuilder model(ILcdModel aModel)
      Sets the model of the layer.
      Overrides:
      model in class ALspLayerBuilder
      Parameters:
      aModel - a model
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the given model is not a WMS model
      See Also:
    • label

      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.

      Overrides:
      label in class ALspLayerBuilder
      Parameters:
      aLabel - the label
      Returns:
      this builder
      See Also:
    • layerType

      public TLspWMSLayerBuilder layerType(ILspLayer.LayerType aLayerType)

      This method is not supported for WMS layers. The default of LayerType#EDITABLE is used.

      Overrides:
      layerType in class ALspLayerBuilder
      Parameters:
      aLayerType - the layer type
      Returns:
      this builder
      Throws:
      UnsupportedOperationException - this method is not supported for WMS layers
      See Also:
    • icon

      public TLspWMSLayerBuilder icon(ILcdIcon aIcon)
      Description copied from class: ALspLayerBuilder
      Sets the icon of the layer.

      The default value is null.

      Overrides:
      icon in class ALspLayerBuilder
      Parameters:
      aIcon - the icon
      Returns:
      this builder
      See Also:
    • layerStyle

      public TLspWMSLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
      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 calling ILspLayer.setLayerStyle(TLspLayerStyle).
      Overrides:
      layerStyle in class ALspLayerBuilder
      Parameters:
      aLayerStyle - the layer style. Must not be null. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
      Returns:
      this
      See Also:
    • paintStrategy

      public TLspWMSLayerBuilder paintStrategy(ELcdWMSPaintStrategy aPaintStrategy)

      Sets the layer's painting strategy.

      By default a ELcdWMSPaintStrategy.TILED approach is used.

      Parameters:
      aPaintStrategy - the paint strategy
      Returns:
      the layer builder
    • borderFactor

      public TLspWMSLayerBuilder borderFactor(double aBorderFactor)
      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 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.

      Parameters:
      aBorderFactor - the surplus border factor value.
      Returns:
      the layer builder.
      Since:
      2018.0
      See Also:
      • TLspWMSLayerBuilder()
    • mapScaleProvider

      public TLspWMSLayerBuilder mapScaleProvider(ILspMapScaleProvider aMapScaleProvider)

      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

      public TLspWMSLayerBuilder sldStyle(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle)

      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