Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmapboxglstylechange_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 Mapbox, Inc.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQMAPBOXGLSTYLECHANGE_P_H
5#define QQMAPBOXGLSTYLECHANGE_P_H
6
7#include <QtCore/QList>
8#include <QtCore/QSharedPointer>
9#include <QtCore/QString>
10#include <QtCore/QVariant>
11#include <QtCore/QVariantMap>
12#include <QtGui/QImage>
13#include <QtLocation/private/qdeclarativecirclemapitem_p.h>
14#include <QtLocation/private/qdeclarativegeomapitembase_p.h>
15#include <QtLocation/private/qdeclarativepolygonmapitem_p.h>
16#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
17#include <QtLocation/private/qdeclarativerectanglemapitem_p.h>
18
19#include <QMapboxGL>
20
22{
23public:
24 virtual ~QMapboxGLStyleChange() = default;
25
26 static QList<QSharedPointer<QMapboxGLStyleChange>> addMapItem(QDeclarativeGeoMapItemBase *, const QString &before);
27 static QList<QSharedPointer<QMapboxGLStyleChange>> removeMapItem(QDeclarativeGeoMapItemBase *);
28
29 virtual void apply(QMapboxGL *map) = 0;
30};
31
33{
34public:
35 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeGeoMapItemBase *);
36
37 void apply(QMapboxGL *map) override;
38
39private:
40 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativePolylineMapItem *);
41
42 QMapboxGLStyleSetLayoutProperty() = default;
43 QMapboxGLStyleSetLayoutProperty(const QString &layer, const QString &property, const QVariant &value);
44
45 QString m_layer;
46 QString m_property;
47 QVariant m_value;
48};
49
51{
52public:
53 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeGeoMapItemBase *);
54
55 void apply(QMapboxGL *map) override;
56
57private:
58 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeRectangleMapItem *);
59 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeCircleMapItem *);
60 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativePolygonMapItem *);
61 static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativePolylineMapItem *);
62
63 QMapboxGLStyleSetPaintProperty() = default;
64 QMapboxGLStyleSetPaintProperty(const QString &layer, const QString &property, const QVariant &value);
65
66 QString m_layer;
67 QString m_property;
68 QVariant m_value;
69};
70
72{
73public:
74 static QSharedPointer<QMapboxGLStyleChange> fromFeature(const QMapbox::Feature &feature, const QString &before);
75
76 void apply(QMapboxGL *map) override;
77
78private:
79 QMapboxGLStyleAddLayer() = default;
80
81 QVariantMap m_params;
82 QString m_before;
83};
84
86{
87public:
88 explicit QMapboxGLStyleRemoveLayer(const QString &id);
89
90 void apply(QMapboxGL *map) override;
91
92private:
93 QMapboxGLStyleRemoveLayer() = default;
94
95 QString m_id;
96};
97
99{
100public:
101 static QSharedPointer<QMapboxGLStyleChange> fromFeature(const QMapbox::Feature &feature);
102 static QSharedPointer<QMapboxGLStyleChange> fromMapItem(QDeclarativeGeoMapItemBase *);
103
104 void apply(QMapboxGL *map) override;
105
106private:
107 QMapboxGLStyleAddSource() = default;
108
109 QString m_id;
110 QVariantMap m_params;
111};
112
114{
115public:
116 explicit QMapboxGLStyleRemoveSource(const QString &id);
117
118 void apply(QMapboxGL *map) override;
119
120private:
121 QMapboxGLStyleRemoveSource() = default;
122
123 QString m_id;
124};
125
127{
128public:
129 void apply(QMapboxGL *map) override;
130
131private:
132 QMapboxGLStyleSetFilter() = default;
133
134 QString m_layer;
135 QVariant m_filter;
136};
137
139{
140public:
141 void apply(QMapboxGL *map) override;
142
143private:
144 QMapboxGLStyleAddImage() = default;
145
146 QString m_name;
147 QImage m_sprite;
148};
149
150#endif // QQMAPBOXGLSTYLECHANGE_P_H
QRectF visibleArea() const override
void setVisibleArea(const QRectF &visibleArea) override
QMapboxGLSettings m_settings
void addMapItem(QDeclarativeGeoMapItemBase *item) override
void changeActiveMapType(const QGeoMapType &mapType) override
QList< QSharedPointer< QMapboxGLStyleChange > > m_styleChanges
QGeoMap::ItemTypes supportedMapItemTypes() const override
void changeCameraData(const QGeoCameraData &oldCameraData) override
Q_DECLARE_FLAGS(SyncStates, SyncState)
void removeMapItem(QDeclarativeGeoMapItemBase *item) override
void changeViewportSize(const QSize &size) override
QSGNode * updateSceneGraph(QSGNode *oldNode, QQuickWindow *window)
void setMapboxGLSettings(const QMapboxGLSettings &, bool useChinaEndpoint)
QString copyrightsStyleSheet() const override
Capabilities capabilities() const override
void setMapItemsBefore(const QString &)
QSGNode * updateSceneGraph(QSGNode *oldNode, QQuickWindow *window) override
static QSharedPointer< QMapboxGLStyleChange > fromFeature(const QMapbox::Feature &feature, const QString &before)
static QSharedPointer< QMapboxGLStyleChange > fromMapItem(QDeclarativeGeoMapItemBase *)
static QSharedPointer< QMapboxGLStyleChange > fromFeature(const QMapbox::Feature &feature)
static QList< QSharedPointer< QMapboxGLStyleChange > > addMapItem(QDeclarativeGeoMapItemBase *, const QString &before)
static QList< QSharedPointer< QMapboxGLStyleChange > > removeMapItem(QDeclarativeGeoMapItemBase *)
virtual ~QMapboxGLStyleChange()=default
QMapboxGLStyleRemoveLayer(const QString &id)
QMapboxGLStyleRemoveSource(const QString &id)
static QList< QSharedPointer< QMapboxGLStyleChange > > fromMapItem(QDeclarativeGeoMapItemBase *)
static QList< QSharedPointer< QMapboxGLStyleChange > > fromMapItem(QDeclarativeGeoMapItemBase *)
StateFlags changedStates() const override
This function should return a mask where each bit represents graphics states changed by the \l render...
void render(const RenderState *state) override
This function is called by the renderer and should paint this node with directly invoking commands vi...
QMapboxGL * map() const
QSGMapboxGLRenderNode(const QMapboxGLSettings &, const QSize &, qreal pixelRatio, QGeoMapMapboxGL *geoMap)
void render(QQuickWindow *)
QSGMapboxGLTextureNode(const QMapboxGLSettings &, const QSize &, qreal pixelRatio, QGeoMapMapboxGL *geoMap)
void resize(const QSize &size, qreal pixelRatio)
QMapboxGL * map() const
#define MBGL_TILE_SIZE