QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MapboxMapProvider.cpp
Go to the documentation of this file.
1#include "MapboxMapProvider.h"
2#include "SettingsManager.h"
3#include "AppSettings.h"
4
5QString MapboxMapProvider::_getURL(int x, int y, int zoom) const
6{
7 const QString mapBoxToken = SettingsManager::instance()->appSettings()->mapboxToken()->rawValue().toString();
8 if (!mapBoxToken.isEmpty()) {
9 if (_mapTypeId == QStringLiteral("mapbox.custom")) {
10 static const QString MapBoxUrlCustom = QStringLiteral("https://api.mapbox.com/styles/v1/%1/%2/tiles/256/%3/%4/%5?access_token=%6");
11 const QString mapBoxAccount = SettingsManager::instance()->appSettings()->mapboxAccount()->rawValue().toString();
12 const QString mapBoxStyle = SettingsManager::instance()->appSettings()->mapboxStyle()->rawValue().toString();
13 return MapBoxUrlCustom.arg(mapBoxAccount).arg(mapBoxStyle).arg(zoom).arg(x).arg(y).arg(mapBoxToken);
14 }
15
16 static const QString MapBoxUrl = QStringLiteral("https://api.mapbox.com/styles/v1/mapbox/%1/tiles/%2/%3/%4?access_token=%5");
17 return MapBoxUrl.arg(_mapTypeId).arg(zoom).arg(x).arg(y).arg(mapBoxToken);
18 }
19 return QString();
20}
Fact *mapboxStyle READ mapboxStyle CONSTANT Fact * mapboxStyle()
Fact *mapboxToken READ mapboxToken CONSTANT Fact * mapboxToken()
Fact *mapboxAccount READ mapboxAccount CONSTANT Fact * mapboxAccount()