MapLibre Native for Qt
|
A helper utility to create and configure map layers in the Map. More...
#include <QMapLibre/LayerParameter>
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. | |
virtual QVariant | parsedProperty (const char *propertyName) const |
Get the property value. | |
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. | |
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.
|
nodiscard |
Layout properties of the layer.
QJsonObject
.
|
nodiscard |
Paint properties of the layer.
QJsonObject
. void QMapLibre::LayerParameter::setLayout | ( | const QJsonObject & | layout | ) |
Set layout properties of the layer.
layout | Layout properties as QJsonObject . |
layoutUpdated() signal is emitted when the layout is updated.
void QMapLibre::LayerParameter::setLayoutProperty | ( | const QString & | key, |
const QVariant & | value ) |
Set layout property.
key | Property name as QString . |
value | Property value as QVariant . |
layoutUpdated() signal is emitted when the layout is updated.
void QMapLibre::LayerParameter::setPaint | ( | const QJsonObject & | paint | ) |
Set paint properties of the layer.
paint | Paint properties as QJsonObject . |
paintUpdated() signal is emitted when the paint is updated.
void QMapLibre::LayerParameter::setPaintProperty | ( | const QString & | key, |
const QVariant & | value ) |
Set paint property.
key | Property name as QString . |
value | Property value as QVariant . |
paintUpdated() signal is emitted when the paint is updated.
void QMapLibre::LayerParameter::setType | ( | const QString & | type | ) |
Set layer type.
type | Layer type as QString . |
|
nodiscard |
Get layer type.
QString
.