Class TLspLonLatGridLayerBuilder
ILspLayer
instances that visualize grid data.
This builder is the recommended way of creating a lon-lat grid layer.
Use labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) and bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) to customize the styling. You have two options:
- Use a TLspLonLatGridStyler to easily style grids.
- Create your own styler. The domain objects you can expect are ILspLonLatGridLine.
Use spacingRange(double, double) to customize the spacing between the grid lines.
- Since:
- 2012.0
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new layer builder. -
Method Summary
Modifier and TypeMethodDescriptionbodyStyler
(TLspPaintState aPaintState, ILspStyler aBodyStyler) Define a styler to be used for body representations.build()
Creates a new layer instance.static ILcdModel
createModel
(String aModelName) Creates a model that can be used by this builder.static ILcdModel
createModel
(String aModelName, ILcdGeodeticDatum aDatum) Creates a model that can be used by this builder.Sets the label of the layer.labelStyler
(TLspPaintState aPaintState, ILspStyler aLabelStyler) Define a styler to be used for label representations.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) Sets the layer type of the layer.Sets the model of the layer.static TLspLonLatGridLayerBuilder
spacingRange
(double aMinimumScale, double aSpacing) Configure the spacing of the grid lines at a certain view scale.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel, icon
-
Field Details
-
GRID_TYPE_NAME
An identifying type for grid layers.- See Also:
-
-
Constructor Details
-
TLspLonLatGridLayerBuilder
protected TLspLonLatGridLayerBuilder()Creates a new layer builder. It will be configured automatically with a model andTLspLonLatGridStyler
s.
-
-
Method Details
-
newBuilder
- Returns:
- a new layer builder configured with a model and
TLspLonLatGridStyler
s
-
createModel
Creates a model that can be used by this builder. When no model is set on the builder, a default model is used instead. When using this method, it is possible to customize the model name which is used as a default display name for the layer created by this builder.
The lon lat grid based on the created model will be based on the geodetic datum of the world reference from the view in which it is visualized. In order to use a different geodetic datum, the
createModel
method can be used.This model should not be shared between different layers.
- Parameters:
aModelName
- The desired model name- Returns:
- A model that can be used in this builder.
-
createModel
Creates a model that can be used by this builder. When no model is set on the builder, a default model is used instead. When using this method, it is possible to customize the following:
- the model name which is used as a default display name for the layer created by this builder
- the geodetic datum that is used by the lon lat grid that is displayed by the layer
This model should not be shared between different layers.
- Parameters:
aModelName
- The desired model name- Returns:
- A model that can be used in this builder.
- Since:
- 2020.1
-
bodyStyler
Define a styler to be used for body representations.You can use a
TLspLonLatGridStyler
, or a styler that can handleILspLonLatGridLine
objects.- Parameters:
aPaintState
- the paint state to use the styler foraBodyStyler
- the styler- Returns:
- this
-
labelStyler
Define a styler to be used for label representations.You can use a
TLspLonLatGridStyler
, or a styler that can handleILspLonLatGridLine
objects.- Parameters:
aPaintState
- the paint state to use the styler foraLabelStyler
- the styler- Returns:
- this
-
spacingRange
Configure the spacing of the grid lines at a certain view scale.Use multiple calls to set different thresholds. The layer will use the spacing that corresponds to the configured scale just below the view scale.
If this call is not used, the default set of scaling ranges is used. The example below shows the default set.
TLspLonLatGridLayerBuilder.newBuilder() .spacingRange(0.048, 1/60.0) // zoomed in .spacingRange(0.024, 1/12.0) .spacingRange(0.012, 1/6.0) .spacingRange(0.006, 1/2.0) .spacingRange(0.0012, 1) .spacingRange(0.000336, 5) .spacingRange(0.0000672, 10) .spacingRange(0, 30) // zoomed out .build()
- Parameters:
aMinimumScale
- The scale below which this spacing becomes activeaSpacing
- The spacing between the lines, in degrees- Returns:
- this
-
build
Description copied from class:ALspLayerBuilder
Creates a new layer instance.
- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-
model
Description copied from class:ALspLayerBuilder
Sets the model of the layer. The default value isnull
.- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a model- Returns:
- this builder
- See Also:
-
label
Description copied from class:ALspLayerBuilder
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 isnull
.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
layerType
Description copied from class:ALspLayerBuilder
Sets the layer type of the layer. The default value isILspLayer.LayerType.EDITABLE
.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the layer type- Returns:
- this builder
- See Also:
-
layerStyle
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 callingILspLayer.setLayerStyle(TLspLayerStyle)
.- Overrides:
layerStyle
in classALspLayerBuilder
- Parameters:
aLayerStyle
- the layer style. Must not benull
. If you want to set the default layer style, setTLspLayerStyle.newBuilder().build()
- Returns:
- this
- See Also:
-