public final class TLspScaleBasedStylerBuilder extends Object
ILspStyler
s 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.
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.
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)
.
Modifier and Type | Field and Description |
---|---|
static double |
FULLY_ZOOMED_IN
Scale value corresponding to a view which is completely zoomed in (= a scale of
Double.MAX_VALUE ). |
static double |
FULLY_ZOOMED_OUT
Scale value corresponding to a view which is completely zoomed out (= a scale of 0.0)
|
Modifier and Type | Method and Description |
---|---|
TLspScaleBasedStyler |
build()
Returns a new
TLspScaleBasedStyler instance. |
static TLspScaleBasedStylerBuilder |
newBuilder()
Create a new builder instance
|
TLspScaleBasedStylerBuilder |
styler(double aMinScale,
double aMaxScale,
ALspStyler aStyler)
Deprecated.
use the method with the
TLcdMapScale to avoid confusion |
TLspScaleBasedStylerBuilder |
styler(TLcdDimensionInterval<TLcdMapScale> aScaleRange,
ALspStyler aStyler)
Adds a styler for the specified scale range.
|
TLspScaleBasedStylerBuilder |
styles(double aMinScale,
double aMaxScale,
ALspStyle... aStyles)
Deprecated.
use the method with the
TLcdMapScale to avoid confusion |
TLspScaleBasedStylerBuilder |
styles(TLcdMapScale aMinScale,
TLcdMapScale aMaxScale,
ALspStyle... aStyles)
Adds styles for the specified scale range.
|
public static final double FULLY_ZOOMED_IN
Double.MAX_VALUE
).public static final double FULLY_ZOOMED_OUT
public static TLspScaleBasedStylerBuilder newBuilder()
public TLspScaleBasedStylerBuilder styles(TLcdMapScale aMinScale, TLcdMapScale aMaxScale, ALspStyle... aStyles)
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.aMinScale
- The minimum scale (inclusive).aMaxScale
- The maximum scale (exclusive).aStyles
- the styles to be used for the defined scale interval.public TLspScaleBasedStylerBuilder styles(double aMinScale, double aMaxScale, ALspStyle... aStyles)
TLcdMapScale
to avoid confusionstyles(TLcdMapScale, TLcdMapScale, ALspStyle...)
for more informationaMinScale
- The minimum scale (inclusive).aMaxScale
- The maximum scale (exclusive).aStyles
- the styles to be used for the defined scale interval.public TLspScaleBasedStylerBuilder styler(TLcdDimensionInterval<TLcdMapScale> aScaleRange, ALspStyler aStyler)
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.aScaleRange
- The minimum and maximum scalesaStyler
- the styler to be used for the defined scale interval.public TLspScaleBasedStylerBuilder styler(double aMinScale, double aMaxScale, ALspStyler aStyler)
TLcdMapScale
to avoid confusionstyles(TLcdMapScale, TLcdMapScale, ALspStyle...)
for more informationaMinScale
- The minimum scale (inclusive).aMaxScale
- The maximum scale (exclusive).aStyler
- the styler to be used for the defined scale interval.public TLspScaleBasedStyler build()
TLspScaleBasedStyler
instance.TLspScaleBasedStyler
.