Package com.luciad.view.lightspeed.style
Class TLspScaleBasedStylerBuilder
java.lang.Object
com.luciad.view.lightspeed.style.TLspScaleBasedStylerBuilder
Builder to create a styler that supports Level-of-Detail styling. Delegate
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.
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 Summary
Modifier and TypeFieldDescriptionstatic final double
Scale value corresponding to a view which is completely zoomed in (= a scale ofDouble.MAX_VALUE
).static final double
Scale value corresponding to a view which is completely zoomed out (= a scale of 0.0) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newTLspScaleBasedStyler
instance.static TLspScaleBasedStylerBuilder
Create a new builder instancestyler
(double aMinScale, double aMaxScale, ALspStyler aStyler) Deprecated.styler
(TLcdDimensionInterval<TLcdMapScale> aScaleRange, ILspStyler aStyler) Adds a styler for the specified scale range.Deprecated.use the method with theTLcdMapScale
to avoid confusionstyles
(TLcdMapScale aMinScale, TLcdMapScale aMaxScale, ALspStyle... aStyles) Adds styles for the specified scale range.
-
Field Details
-
FULLY_ZOOMED_IN
public static final double FULLY_ZOOMED_INScale value corresponding to a view which is completely zoomed in (= a scale ofDouble.MAX_VALUE
).- See Also:
-
FULLY_ZOOMED_OUT
public static final double FULLY_ZOOMED_OUTScale value corresponding to a view which is completely zoomed out (= a scale of 0.0)- See Also:
-
-
Method Details
-
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 ofTLspScaleBasedStylerBuilder
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 fromTLcdMapScale.MAX_ZOOMED_OUT
toTLcdMapScale.MAX_ZOOMED_IN
. Note: To filter objects and minimize data loading in a layerTLcdModelQueryConfiguration
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 theTLcdMapScale
to avoid confusionAdds styles for the specified scale range. Seestyles(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
public TLspScaleBasedStylerBuilder styler(TLcdDimensionInterval<TLcdMapScale> aScaleRange, ILspStyler aStyler) 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 ofTLspScaleBasedStylerBuilder
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 layerTLcdModelQueryConfiguration
should be used.- Parameters:
aScaleRange
- The minimum and maximum scalesaStyler
- 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 theTLcdMapScale
to avoid confusionAdds a styler for the specified scale range. Seestyles(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
Returns a newTLspScaleBasedStyler
instance.- Returns:
- a new
TLspScaleBasedStyler
.
-
TLcdMapScale
to avoid confusion