Class TLspScaleBasedStylerBuilder

java.lang.Object
com.luciad.view.lightspeed.style.TLspScaleBasedStylerBuilder

public final class TLspScaleBasedStylerBuilder extends Object
Builder to create a styler that supports Level-of-Detail styling. Delegate ILspStylers configured via this builder are used for the styling at the defined map scale intervals. For intervals that have no styles defined, nothing will be painted.

Overlapping scale ranges

It is allowed to specify overlapping scale ranges. For example

   TLspScaleBasedStylerBuilder builder = TLspScaleBasedStylerBuilder.newBuilder();
   TLspScaleBasedStyler scaleBasedStyle =
     builder.styles( 1e-5, 1e-7, iconStyle1 )
            .styles( FULLY_ZOOMED_OUT, FULLY_ZOOMED_IN, iconStyle2 )
            .build();
 
defines overlapping styles for the interval [1e-5, 1e-7[. In that interval, both the iconStyle1 and iconStyle2 are used to style the objects on the map.

Example


  ALspStyle iconStyle1 = TLspIconStyle.newBuilder()
                                      .icon(new TLcdSymbol(TLcdSymbol.FILLED_CIRCLE, 20, Color.RED))
                                      .build();
  ALspStyle iconStyle2 = TLspIconStyle.newBuilder()
                                      .icon(new TLcdSymbol(TLcdSymbol.FILLED_TRIANGLE, 20, Color.GREEN))
                                      .build();

  TLspScaleBasedStyler scaleBasedStyle = TLspScaleBasedStylerBuilder.newBuilder()
                                                                    .styles(FULLY_ZOOMED_OUT, 1e-7, iconStyle1)
                                                                    .styles(1e-7, FULLY_ZOOMED_IN, iconStyle2)
                                                                    .build();
 

Note: The scale dependent styler created with this builder, has no influence on which data is loaded by a layer. To filter objects in a layer TLcdModelQueryConfiguration must be used, which can be configured on the layer via TLspLayer.setModelQueryConfiguration(com.luciad.view.TLcdModelQueryConfiguration).

Since:
2017.1
  • Field Details

    • FULLY_ZOOMED_IN

      public static final double FULLY_ZOOMED_IN
      Scale value corresponding to a view which is completely zoomed in (= a scale of Double.MAX_VALUE).
      See Also:
    • FULLY_ZOOMED_OUT

      public static final double FULLY_ZOOMED_OUT
      Scale value corresponding to a view which is completely zoomed out (= a scale of 0.0)
      See Also:
  • Method Details

    • newBuilder

      public static TLspScaleBasedStylerBuilder newBuilder()
      Create a new builder instance
      Returns:
      a new builder instance
    • styles

      public TLspScaleBasedStylerBuilder styles(TLcdMapScale aMinScale, TLcdMapScale aMaxScale, ALspStyle... aStyles)
      Adds styles for the specified scale range. Scale ranges are allowed to overlap with previously specified scale ranges. If the current scale of the view is within multiple scale ranges, all associated styles will be applied. The order in which the scale ranges and their associated styles are defined has no effect. Consult the class javadoc of TLspScaleBasedStylerBuilder for more information on how overlapping scale ranges are interpreted.

      The scales are expressed as a unitless scale. For example specifying a scale of "1/5000" means that one centimeter on the map equals 5000 centimeters in reality. Valid scale values go from TLcdMapScale.MAX_ZOOMED_OUT to TLcdMapScale.MAX_ZOOMED_IN.

      Note: To filter objects and minimize data loading in a layer TLcdModelQueryConfiguration should be used.

      Parameters:
      aMinScale - The minimum scale (inclusive).
      aMaxScale - The maximum scale (exclusive).
      aStyles - the styles to be used for the defined scale interval.
      Returns:
      this builder
      Since:
      2021.0
    • styles

      @Deprecated public TLspScaleBasedStylerBuilder styles(double aMinScale, double aMaxScale, ALspStyle... aStyles)
      Deprecated.
      use the method with the TLcdMapScale to avoid confusion
      Adds styles for the specified scale range. See styles(TLcdMapScale, TLcdMapScale, ALspStyle...) for more information
      Parameters:
      aMinScale - The minimum scale (inclusive).
      aMaxScale - The maximum scale (exclusive).
      aStyles - the styles to be used for the defined scale interval.
      Returns:
      this builder
    • styler

      Adds a styler for the specified scale range. Scale ranges are allowed to overlap with previously specified scale ranges. If the current scale of the view is within multiple scale ranges, all associated stylers will be applied. The order in which the scale ranges and their associated stylers are defined has no effect. Consult the class javadoc of TLspScaleBasedStylerBuilder for more information on how overlapping scale ranges are interpreted.

      The scales are expressed as a unitless scale. For example specifying a scale of "1/5000" means that one centimetre on the map equals 5000 centimetres in reality.

      Note: To filter objects and minimize data loading in a layer TLcdModelQueryConfiguration should be used.

      Parameters:
      aScaleRange - The minimum and maximum scales
      aStyler - the styler to be used for the defined scale interval.
      Returns:
      this builder
      Since:
      2021.0
    • styler

      @Deprecated public TLspScaleBasedStylerBuilder styler(double aMinScale, double aMaxScale, ALspStyler aStyler)
      Deprecated.
      use the method with the TLcdMapScale to avoid confusion
      Adds a styler for the specified scale range. See styles(TLcdMapScale, TLcdMapScale, ALspStyle...) for more information
      Parameters:
      aMinScale - The minimum scale (inclusive).
      aMaxScale - The maximum scale (exclusive).
      aStyler - the styler to be used for the defined scale interval.
      Returns:
      this builder
    • build

      public TLspScaleBasedStyler build()
      Returns a new TLspScaleBasedStyler instance.
      Returns:
      a new TLspScaleBasedStyler.