Class TLspMBTilesVectorLayerBuilder
java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.format.mbtiles.view.lightspeed.TLspMBTilesVectorLayerBuilder
Layer builder for models containing MBTiles vector data, as produced by
TLcdMBTilesModelDecoder
. For models containing image data,
use TLspRasterLayerBuilder
.
Vector tile layers automatically load tiles from a detail level which is appropriate for the current view. If so
desired, the qualityFactor(double)
method can be used to bias the tile selection toward a higher or lower
level of detail.
Vector tile layers generally provide the same styling options as
TLspShapeLayerBuilder
. See
TLcdMBTilesModelDecoder
for more information on the
modeling of vector tile features as they are presented to your styler. Also note that density styling is not
supported for vector tiles. Furthermore, the use of
complex strokes
is not recommended as it is
likely to produce disturbing discontinuities in the stroke pattern where lines touch a tile boundary.
Like other vector features, you can select MBTiles vector tile features using
TLspSelectController
. However, vector
tile features can be truncated at the boundaries of the tile that contain them. To enable selection styling for
objects that span across multiple tiles, see uidProvider(Function)
.
For more information on working with MBTiles vector data, refer to the tutorial
Working with MBTiles data.- Since:
- 2023.1
-
Method Summary
Modifier and TypeMethodDescriptionbodyMapScaleRange
(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange) Sets the body scale range for this layer in unitless map scale ratios.bodyScaleRange
(ILcdInterval aBodyScaleRange) Sets the body scale range for this layer.bodyStyler
(TLspPaintState aPaintState, ILspStyler aBodyStyler) Sets the body styler for the given paint state.bodyStyles
(TLspPaintState aPaintState, ALspStyle... aBodyStyles) Sets the body styles for the given paint state.build()
Creates a new layer instance.Sets the icon of the layer.Sets the label of the layer.labelMapScaleRange
(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange) Sets the label scale range for this layer in unitless map scale ratios.labelScaleRange
(ILcdInterval aLabelScaleRange) Sets the label scale range for this layer.labelStyler
(TLspPaintState aPaintState, ILspStyler aLabelStyler) Sets the label styler for the given paint state.labelStyles
(TLspPaintState aPaintState, ALspStyle... aLabelStyles) Sets the label styles for the given paint state.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.Sets the model of the layer.qualityFactor
(double aFactor) Sets a quality factor that biases the level-of-detail selection of the vector tile layer.selectable
(boolean aSelectable) selectableSupported
(boolean aSelectableSupported) sldStyle
(TLcdSLDFeatureTypeStyle aFeatureTypeStyle) Assigns the supplied SLD style to both the bodies and the labels of the vector tile layer.uidProvider
(Function<Object, Object> aProvider) Sets a unique ID provider that you can use to identify a conceptual map feature across tile boundaries and detail levels.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel, layerType
-
Method Details
-
newBuilder
-
qualityFactor
Sets a quality factor that biases the level-of-detail selection of the vector tile layer. You can use this setting to trade off between visual quality and performance.
The default value is 1.0. Higher values increase the detail level, lower values decrease it.
- Parameters:
aFactor
- the scale factor for the layer's level of detail. Values smaller than 1 will decrease the detail level. Values larger than 1 increase the detail level.- Returns:
this
-
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:
-
icon
Description copied from class:ALspLayerBuilder
Sets the icon of the layer. The default value isnull
.- Overrides:
icon
in classALspLayerBuilder
- Parameters:
aIcon
- the icon- 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:
-
bodyStyler
Sets the body styler for the given paint state.- Returns:
this
- See Also:
-
bodyStyles
public TLspMBTilesVectorLayerBuilder bodyStyles(TLspPaintState aPaintState, ALspStyle... aBodyStyles) Sets the body styles for the given paint state.- Returns:
this
- See Also:
-
uidProvider
Sets a unique ID provider that you can use to identify a conceptual map feature across tile boundaries and detail levels. The provider takes as input a vector tile feature, meaning an element contained within a single tile, and returns an ID that is shared by any and all parts of that same object which lie in other tiles. If the user then selects a vector tile feature on the map, all features with the same UID, even in other tiles or on other detail levels, will be painted consistently with the same selection styling. The UIDs can technically be of any type. The layer usesequals()
to compare them. Typical implementations retrieve a known data property from the feature usingILcdDataObject
. If not set by the user, a default UID provider extracts the "feature ID" attribute from the MBTiles data. Not all tools generate useful values for this attribute by default, though, so it might not work for all data.- Parameters:
aProvider
- a function which returns a unique ID for a given feature.- Returns:
this
-
build
Description copied from class:ALspLayerBuilder
Creates a new layer instance.
- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-
labelStyler
public TLspMBTilesVectorLayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aLabelStyler) Sets the label styler for the given paint state.- Returns:
this
- See Also:
-
selectable
-
selectableSupported
-
labelStyles
public TLspMBTilesVectorLayerBuilder labelStyles(TLspPaintState aPaintState, ALspStyle... aLabelStyles) Sets the label styles for the given paint state.- Returns:
this
- See Also:
-
bodyScaleRange
Sets the body scale range for this layer.- Returns:
this
- See Also:
-
bodyMapScaleRange
public TLspMBTilesVectorLayerBuilder bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange) Sets the body scale range for this layer in unitless map scale ratios.- Returns:
this
- See Also:
-
labelScaleRange
Sets the label scale range for this layer.- Returns:
this
- See Also:
-
labelMapScaleRange
public TLspMBTilesVectorLayerBuilder labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange) Sets the label scale range for this layer in unitless map scale ratios.- Returns:
this
- See Also:
-
sldStyle
Assigns the supplied SLD style to both the bodies and the labels of the vector tile layer. Note that it is not possible to create aTLspSLDStyler
externally and assign it to the layer usingbodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
orlabelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
.- Returns:
this
-