public final class TLspScaleBasedStylerBuilder
extends java.lang.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();
ALspStyler scaleBasedStyle =
builder.addContent( 1e-5, 1e-7, iconStyle1 )
.addContent( 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();
ALspStyler 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 |
---|---|
ALspStyler |
build()
Returns a new
ALspStyler instance. |
static TLspScaleBasedStylerBuilder |
newBuilder()
Create a new builder instance
|
TLspScaleBasedStylerBuilder |
styler(double aMinScale,
double aMaxScale,
ALspStyler aStyler)
Adds a styler for the specified scale range.
|
TLspScaleBasedStylerBuilder |
styles(double aMinScale,
double 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(double aMinScale, double 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 centimetre on the map equals 5000 centimetres
in reality.
Valid scale values go from FULLY_ZOOMED_OUT
(=0.0) to FULLY_ZOOMED_IN
(=Double.MAX_VALUE
).
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 styler(double aMinScale, double aMaxScale, 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.
Valid scale values go from FULLY_ZOOMED_OUT
(=0.0) to FULLY_ZOOMED_IN
(=Double.MAX_VALUE
).
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).aStyler
- the styler to be used for the defined scale interval.public ALspStyler build()
ALspStyler
instance.ALspStyler
.