MapboxMapProvider.h 4.83 KB
Newer Older
Cosmin Marc's avatar
Cosmin Marc committed
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
Cosmin Marc's avatar
Cosmin Marc committed
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

Pierre TILAK's avatar
Pierre TILAK committed
10 11 12 13
#pragma once

#include "MapProvider.h"

Cosmin Marc's avatar
Cosmin Marc committed
14 15
static const quint32 AVERAGE_MAPBOX_SAT_MAP     = 15739;
static const quint32 AVERAGE_MAPBOX_STREET_MAP  = 5648;
16

Pierre TILAK's avatar
Pierre TILAK committed
17 18
class MapboxMapProvider : public MapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
19 20 21 22 23 24 25 26

public:
    MapboxMapProvider(const QString& mapName, const quint32 averageSize, const QGeoMapType::MapStyle mapType, QObject* parent = nullptr);

protected:
    QString _getURL(const int x, const int y, const int zoom, QNetworkAccessManager* networkManager) override;

    QString _mapboxName;
Pierre TILAK's avatar
Pierre TILAK committed
27 28 29 30
};

class MapboxStreetMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
31 32 33 34

public:
    MapboxStreetMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.streets"), AVERAGE_MAPBOX_STREET_MAP,
Pierre TILAK's avatar
Pierre TILAK committed
35 36 37 38 39
                            QGeoMapType::StreetMap, parent) {}
};

class MapboxLightMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
40 41 42 43

public:
    MapboxLightMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.light"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
44 45 46 47 48
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxDarkMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
49 50 51 52

public:
    MapboxDarkMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.dark"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
53 54 55 56 57
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxSatelliteMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
58 59 60 61

public:
    MapboxSatelliteMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.satellite"), AVERAGE_MAPBOX_SAT_MAP,
Pierre TILAK's avatar
Pierre TILAK committed
62 63 64 65 66
                            QGeoMapType::SatelliteMapDay, parent) {}
};

class MapboxHybridMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
67 68 69 70

public:
    MapboxHybridMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.hybrid"), AVERAGE_MAPBOX_SAT_MAP,
Pierre TILAK's avatar
Pierre TILAK committed
71 72 73 74 75
                            QGeoMapType::HybridMap, parent) {}
};

class MapboxWheatPasteMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
76 77 78 79

public:
    MapboxWheatPasteMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.wheatpaste"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
80 81 82 83 84
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxStreetsBasicMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
85 86 87 88

public:
    MapboxStreetsBasicMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.streets-basic"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
89 90 91 92 93
                            QGeoMapType::StreetMap, parent) {}
};

class MapboxComicMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
94 95 96 97

public:
    MapboxComicMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.comic"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
98 99 100 101 102
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxOutdoorsMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
103 104 105 106

public:
    MapboxOutdoorsMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.outdoors"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
107 108 109 110 111
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxRunBikeHikeMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
112 113 114 115

public:
    MapboxRunBikeHikeMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.run-bike-hike"), AVERAGE_MAPBOX_STREET_MAP,
Pierre TILAK's avatar
Pierre TILAK committed
116 117 118 119 120
                            QGeoMapType::CycleMap, parent) {}
};

class MapboxPencilMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
121 122 123 124

public:
    MapboxPencilMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.pencil"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
125 126 127 128 129
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxPiratesMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
130 131 132 133

public:
    MapboxPiratesMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.pirates"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
134 135 136 137 138
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxEmeraldMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
139 140 141 142

public:
    MapboxEmeraldMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.emerald"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
143 144 145 146 147
                            QGeoMapType::CustomMap, parent) {}
};

class MapboxHighContrastMapProvider : public MapboxMapProvider {
    Q_OBJECT
Cosmin Marc's avatar
Cosmin Marc committed
148 149 150 151

public:
    MapboxHighContrastMapProvider(QObject* parent = nullptr)
        : MapboxMapProvider(QStringLiteral("mapbox.high-contrast"), AVERAGE_TILE_SIZE,
Pierre TILAK's avatar
Pierre TILAK committed
152 153
                            QGeoMapType::CustomMap, parent) {}
};