LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::MbTilesFeatureLayer Class Referencefinal

A layer for feature tile models. More...

#include <luciad/layers/mbtiles/MbTilesFeatureLayer.h>

Inheritance diagram for luciad::MbTilesFeatureLayer:
luciad::Layer

Classes

class  Builder
 Builder for the luciad::MbTilesFeatureLayer class. More...

Public Member Functions

 ~MbTilesFeatureLayer () override
void addObserver (std::shared_ptr< ILayerObserver > layerObserver) override
 Adds an observer that allows to receive change events from this layer.
Builder asBuilder () const
 Returns a new builder based on this layer instance.
const std::shared_ptr< IFeatureTileModel > & getModel () const
 Returns the layer's model, which provides the feature tiles to present.
const std::string & getTitle () const override
 Returns the layer's title.
bool isBusy () const override
 Returns whether this layer is busy loading data, rendering, loading attributions, or anything else.
bool isLabeled () const
 Returns whether this layer displays labels.
bool isVisible () const override
 Returns whether this layer is visible.
void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver) override
 Removes the given observer.
void setLabeled (bool labeled)
 Sets whether this layer displays labels.
void setStyle (std::string path)
 Sets the style of the layer.
void setTitle (std::string title) override
 Sets the layer's title.
void setVisible (bool visible) override
 Sets whether this layer is visible.
Public Member Functions inherited from luciad::Layer
 Layer ()
 Default constructor.
virtual ~Layer ()=default
virtual LayerId getId () const
 Returns the layer's unique id.

Static Public Member Functions

static Builder newBuilder ()
 Returns a new builder for creating a MbTilesFeatureLayer.
static const std::string & propertyLabeled ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.
static const std::string & propertyStyle ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's style.
Static Public Member Functions inherited from luciad::Layer
static const std::string & propertyBusy ()
 Property name for the LayerEvent that is fired as a result of the layer's busy flag changing.
static const std::string & propertyTitle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's title.
static const std::string & propertyVisible ()
 Property name for the LayerEvent that is fired as a result of changing the layer's visible flag.

Detailed Description

A layer for feature tile models.

Use luciad::MbTilesFeatureLayer::newBuilder to create a feature tile layer instance.

Since
2024.0

Constructor & Destructor Documentation

◆ ~MbTilesFeatureLayer()

luciad::MbTilesFeatureLayer::~MbTilesFeatureLayer ( )
override

Member Function Documentation

◆ addObserver()

void luciad::MbTilesFeatureLayer::addObserver ( std::shared_ptr< ILayerObserver > layerObserver)
overridevirtual

Adds an observer that allows to receive change events from this layer.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

Parameters
layerObserveran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer was already added.
luciad::NullArgumentExceptionwhen the observer is nullptr.

Implements luciad::Layer.

◆ asBuilder()

Builder luciad::MbTilesFeatureLayer::asBuilder ( ) const

Returns a new builder based on this layer instance.

You can use this builder, for example, to create a copy of this layer.

Note that observers will not be transferred to a new layer.

Returns
a new builder based on this layer instance.
Since
2025.0

◆ getModel()

const std::shared_ptr< IFeatureTileModel > & luciad::MbTilesFeatureLayer::getModel ( ) const

Returns the layer's model, which provides the feature tiles to present.

Returns
the layer's model, which provides the feature tiles to present.

◆ getTitle()

const std::string & luciad::MbTilesFeatureLayer::getTitle ( ) const
overridevirtual

Returns the layer's title.

Should be suitable for presenting to the user.

Returns
the layer's title, should be suitable for presenting to the user.

Implements luciad::Layer.

◆ isBusy()

bool luciad::MbTilesFeatureLayer::isBusy ( ) const
overridevirtual

Returns whether this layer is busy loading data, rendering, loading attributions, or anything else.

When this property changes, a LayerEvent is delivered to the observers with the property name propertyBusy.

Note: when the map is moving around it can be that the layer is repeatedly loading new data, but does this fast enough that it is done by the time new data is needed, resulting in a repeatedly changing busyness state.

Returns
whether this layer is busy.
Since
2024.1

Implements luciad::Layer.

◆ isLabeled()

bool luciad::MbTilesFeatureLayer::isLabeled ( ) const

Returns whether this layer displays labels.

Returns
whether this layer displays labels.

◆ isVisible()

bool luciad::MbTilesFeatureLayer::isVisible ( ) const
overridevirtual

Returns whether this layer is visible.

Returns
whether this layer is visible.

Implements luciad::Layer.

◆ newBuilder()

Builder luciad::MbTilesFeatureLayer::newBuilder ( )
static

Returns a new builder for creating a MbTilesFeatureLayer.

Returns
a new builder for creating a MbTilesFeatureLayer.

◆ propertyLabeled()

const std::string & luciad::MbTilesFeatureLayer::propertyLabeled ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.
See also
setLabeled

◆ propertyStyle()

const std::string & luciad::MbTilesFeatureLayer::propertyStyle ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's style.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's style.
See also
setStyle

◆ removeObserver()

void luciad::MbTilesFeatureLayer::removeObserver ( const std::shared_ptr< ILayerObserver > & layerObserver)
overridevirtual

Removes the given observer.

If the given observer was never added, an exception is thrown.

Parameters
layerObserveran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer is not known.
luciad::NullArgumentExceptionwhen the observer is nullptr.

Implements luciad::Layer.

◆ setLabeled()

void luciad::MbTilesFeatureLayer::setLabeled ( bool labeled)

Sets whether this layer displays labels.

Note that both icons and text (i.e. Mapbox symbols) are considered labels.

Parameters
labeledtrue to enable labels.

◆ setStyle()

void luciad::MbTilesFeatureLayer::setStyle ( std::string path)

Sets the style of the layer.

Calling this method results in new model queries and a full reload of all visible tiles with the new style.

When setting a new style, a LayerEvent is delivered to the observers with the property name MbTilesFeatureLayer::propertyStyle.

Parameters
paththe path to a style file. Can be a URL or a file path to a JSON file.
Exceptions
luciad::IOExceptionIf decoding the style fails.
See also
MbTilesFeatureLayer::Builder::style for the list of supported styles.

◆ setTitle()

void luciad::MbTilesFeatureLayer::setTitle ( std::string title)
overridevirtual

Sets the layer's title.

Should be suitable for presenting to the user.

If the new title is indeed different from the old one, a LayerEvent is delivered to the observers with the property name PropertyTitle.

Parameters
titlethe new title.

Implements luciad::Layer.

◆ setVisible()

void luciad::MbTilesFeatureLayer::setVisible ( bool visible)
overridevirtual

Sets whether this layer is visible.

Changes this layer's visibility. If the new visibility is different from the old one, a LayerEvent is delivered to the observers with the property name PropertyVisible.

Parameters
visiblethe new visibility.

Implements luciad::Layer.