MapLibre Native for Qt
Loading...
Searching...
No Matches
QMapLibre::LayerParameter Class Reference

A helper utility to create and configure map layers in the Map. More...

#include <QMapLibre/LayerParameter>

Inheritance diagram for QMapLibre::LayerParameter:
QMapLibre::StyleParameter

Signals

void layoutUpdated ()
 Signal emitted when the layer layout is updated.
 
void paintUpdated ()
 Signal emitted when the layer paint is updated.
 
- Signals inherited from QMapLibre::StyleParameter
void ready (StyleParameter *parameter)
 Signal emitted when the style parameter is ready.
 
void updated (StyleParameter *parameter)
 Signal emitted when the style parameter is updated.
 

Public Member Functions

 LayerParameter (QObject *parent=nullptr)
 Default constructor.
 
QString type () const
 Get layer type.
 
void setType (const QString &type)
 Set layer type.
 
QJsonObject layout () const
 Layout properties of the layer.
 
void setLayout (const QJsonObject &layout)
 Set layout properties of the layer.
 
Q_INVOKABLE void setLayoutProperty (const QString &key, const QVariant &value)
 Set layout property.
 
QJsonObject paint () const
 Paint properties of the layer.
 
void setPaint (const QJsonObject &paint)
 Set paint properties of the layer.
 
Q_INVOKABLE void setPaintProperty (const QString &key, const QVariant &value)
 Set paint property.
 
- Public Member Functions inherited from QMapLibre::StyleParameter
 StyleParameter (QObject *parent=nullptr)
 Default constructor.
 
bool operator== (const StyleParameter &other) const
 Comparison operator.
 
bool isReady () const
 Check if the style parameter is ready.
 
bool hasProperty (const char *propertyName) const
 Check for property existence.
 
void updateProperty (const char *propertyName, const QVariant &value)
 Update property value.
 
QVariantMap toVariantMap () const
 Return a map of all properties.
 
QString styleId () const
 Return style identifier.
 
void setStyleId (const QString &id)
 Set style identifier.
 

Protected Attributes

QString m_type
 Type of the source configured.
 
QJsonObject m_layout
 Layout properties of the layer.
 
QJsonObject m_paint
 Paint properties of the layer.
 
- Protected Attributes inherited from QMapLibre::StyleParameter
const int m_initialPropertyCount = staticMetaObject.propertyCount()
 Number of properties in the base class.
 
bool m_ready {}
 Ready status of the style parameter.
 
QString m_styleId
 Style identifier of the parameter.
 

Additional Inherited Members

- Public Slots inherited from QMapLibre::StyleParameter
void updateNotify ()
 Notify that the style parameter has been updated.
 

Detailed Description

A helper utility to create and configure map layers in the Map.

Needs to have a type set to one of the supported types. Other properties are set dynamically, depending on the type.

Member Function Documentation

◆ layout()

QJsonObject QMapLibre::LayerParameter::layout ( ) const
nodiscard

Layout properties of the layer.

Returns
Layout properties as QJsonObject.

◆ paint()

QJsonObject QMapLibre::LayerParameter::paint ( ) const
nodiscard

Paint properties of the layer.

Returns
Paint properties as QJsonObject.

◆ setLayout()

void QMapLibre::LayerParameter::setLayout ( const QJsonObject & layout)

Set layout properties of the layer.

Parameters
layoutLayout properties as QJsonObject.

layoutUpdated() signal is emitted when the layout is updated.

◆ setLayoutProperty()

void QMapLibre::LayerParameter::setLayoutProperty ( const QString & key,
const QVariant & value )

Set layout property.

Parameters
keyProperty name as QString.
valueProperty value as QVariant.

layoutUpdated() signal is emitted when the layout is updated.

◆ setPaint()

void QMapLibre::LayerParameter::setPaint ( const QJsonObject & paint)

Set paint properties of the layer.

Parameters
paintPaint properties as QJsonObject.

paintUpdated() signal is emitted when the paint is updated.

◆ setPaintProperty()

void QMapLibre::LayerParameter::setPaintProperty ( const QString & key,
const QVariant & value )

Set paint property.

Parameters
keyProperty name as QString.
valueProperty value as QVariant.

paintUpdated() signal is emitted when the paint is updated.

◆ setType()

void QMapLibre::LayerParameter::setType ( const QString & type)

Set layer type.

Parameters
typeLayer type as QString.

◆ type()

QString QMapLibre::LayerParameter::type ( ) const
nodiscard

Get layer type.

Returns
Layer type as QString.