MapLibre Native for Qt
Loading...
Searching...
No Matches
layer_parameter.hpp
1// Copyright (C) 2023 MapLibre contributors
2
3// SPDX-License-Identifier: BSD-2-Clause
4
5#ifndef QMAPLIBRE_LAYER_PARAMETER_H
6#define QMAPLIBRE_LAYER_PARAMETER_H
7
8#include "style_parameter.hpp"
9
10#include <QMapLibre/Export>
11
12#include <QtCore/QJsonObject>
13#include <QtCore/QObject>
14#include <QtCore/QString>
15
16namespace QMapLibre {
17
18class Q_MAPLIBRE_CORE_EXPORT LayerParameter : public StyleParameter {
19 Q_OBJECT
20public:
21 explicit LayerParameter(QObject *parent = nullptr);
22 ~LayerParameter() override;
23
24 [[nodiscard]] QString type() const;
25 void setType(const QString &type);
26
27 [[nodiscard]] QJsonObject layout() const;
28 void setLayout(const QJsonObject &layout);
29 Q_INVOKABLE void setLayoutProperty(const QString &key, const QVariant &value);
30
31 [[nodiscard]] QJsonObject paint() const;
32 void setPaint(const QJsonObject &paint);
33 Q_INVOKABLE void setPaintProperty(const QString &key, const QVariant &value);
34
35Q_SIGNALS:
38
39protected:
40 QString m_type;
41 QJsonObject m_layout;
42 QJsonObject m_paint;
43
44 Q_DISABLE_COPY(LayerParameter)
45};
46
47} // namespace QMapLibre
48
49#endif // QMAPLIBRE_LAYER_PARAMETER_H
A helper utility to create and configure map layers in the Map.
Definition layer_parameter.hpp:18
QJsonObject m_paint
Paint properties of the layer.
Definition layer_parameter.hpp:42
void layoutUpdated()
Signal emitted when the layer layout is updated.
QJsonObject m_layout
Layout properties of the layer.
Definition layer_parameter.hpp:41
void paintUpdated()
Signal emitted when the layer paint is updated.
QString m_type
Type of the source configured.
Definition layer_parameter.hpp:40
A base class to pass style parameters to Map.
Definition style_parameter.hpp:16
Definition geojson.cpp:10