Commit 86f9a219 authored by dogmaphobic's avatar dogmaphobic

Adding url factory from Open Pilot maps.

As this is no longer google specific, renamed everything google to qgc.
parent 3edd02a3
TARGET = qtgeoservices_google
CONFIG += static
QT += location-private positioning-private network
PLUGIN_TYPE = geoservices
PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryGoogle
load(qt_plugin)
INCLUDEPATH += $$QT.location.includes
HEADERS += \
$$PWD/src/qgeoserviceproviderplugingoogle.h \
$$PWD/src/qgeotiledmappingmanagerenginegoogle.h \
$$PWD/src/qgeotilefetchergoogle.h \
$$PWD/src/qgeomapreplygoogle.h \
$$PWD/src/qgeocodingmanagerenginegoogle.h \
$$PWD/src/qgeocodereplygoogle.h
SOURCES += \
$$PWD/src/qgeoserviceproviderplugingoogle.cpp \
$$PWD/src/qgeotiledmappingmanagerenginegoogle.cpp \
$$PWD/src/qgeotilefetchergoogle.cpp \
$$PWD/src/qgeomapreplygoogle.cpp \
$$PWD/src/qgeocodingmanagerenginegoogle.cpp \
$$PWD/src/qgeocodereplygoogle.cpp
OTHER_FILES += \
$$PWD/google_maps_plugin.json
TARGET = qtgeoservices_qgc
CONFIG += static
QT += location-private positioning-private network
PLUGIN_TYPE = geoservices
PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryQGC
load(qt_plugin)
INCLUDEPATH += $$QT.location.includes
HEADERS += \
$$PWD/src/qgeoserviceproviderpluginqgc.h \
$$PWD/src/qgeotiledmappingmanagerengineqgc.h \
$$PWD/src/qgeotilefetcherqgc.h \
$$PWD/src/qgeomapreplyqgc.h \
$$PWD/src/qgeocodingmanagerengineqgc.h \
$$PWD/src/qgeocodereplyqgc.h \
$$PWD/src/OpenPilotMaps.h
SOURCES += \
$$PWD/src/qgeoserviceproviderpluginqgc.cpp \
$$PWD/src/qgeotiledmappingmanagerengineqgc.cpp \
$$PWD/src/qgeotilefetcherqgc.cpp \
$$PWD/src/qgeomapreplyqgc.cpp \
$$PWD/src/qgeocodingmanagerengineqgc.cpp \
$$PWD/src/qgeocodereplyqgc.cpp \
$$PWD/src/OpenPilotMaps.cc
OTHER_FILES += \
$$PWD/qgc_maps_plugin.json
{ {
"Keys": ["google-maps"], "Keys": ["qgc-maps"],
"Provider": "google", "Provider": "QGroundControl",
"Version": 100, "Version": 101,
"Experimental": false, "Experimental": false,
"Features": [ "Features": [
"OnlineMappingFeature", "OnlineMappingFeature",
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief QGC Open Pilot Mapping Tools
* @author Gus Grubba <mavlink@grubba.com>
* Original work: The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
*/
#ifndef OPENPILOTTOOLS_H
#define OPENPILOTTOOLS_H
#include <QString>
#include <Qpoint>
#include <QByteArray>
#include <QNetworkProxy>
namespace OpenPilot {
enum MapType
{
GoogleMap = 1,
GoogleSatellite = 4,
GoogleLabels = 8,
GoogleTerrain = 16,
GoogleHybrid = 20,
GoogleMapChina = 22,
GoogleSatelliteChina = 24,
GoogleLabelsChina = 26,
GoogleTerrainChina = 28,
GoogleHybridChina = 29,
OpenStreetMap = 32,
OpenStreetOsm = 33,
OpenStreetMapSurfer = 34,
OpenStreetMapSurferTerrain=35,
YahooMap = 64,
YahooSatellite = 128,
YahooLabels = 256,
YahooHybrid = 333,
BingMap = 444,
BingSatellite = 555,
BingHybrid = 666,
ArcGIS_Map = 777,
ArcGIS_Satellite = 788,
ArcGIS_ShadedRelief = 799,
ArcGIS_Terrain = 811,
ArcGIS_MapsLT_Map = 1000,
ArcGIS_MapsLT_OrtoFoto = 1001,
ArcGIS_MapsLT_Map_Labels= 1002,
ArcGIS_MapsLT_Map_Hybrid= 1003,
PergoTurkeyMap = 2001,
SigPacSpainMap = 3001,
GoogleMapKorea = 4001,
GoogleSatelliteKorea = 4002,
GoogleLabelsKorea = 4003,
GoogleHybridKorea = 4005,
YandexMapRu = 5000
};
class ProviderStrings {
public:
ProviderStrings();
static const QString levelsForSigPacSpainMap[];
QString GoogleMapsAPIKey;
// Google version strings
QString VersionGoogleMap;
QString VersionGoogleSatellite;
QString VersionGoogleLabels;
QString VersionGoogleTerrain;
QString SecGoogleWord;
// Google (China) version strings
QString VersionGoogleMapChina;
QString VersionGoogleSatelliteChina;
QString VersionGoogleLabelsChina;
QString VersionGoogleTerrainChina;
// Google (Korea) version strings
QString VersionGoogleMapKorea;
QString VersionGoogleSatelliteKorea;
QString VersionGoogleLabelsKorea;
/// <summary>
/// Google Maps API generated using http://greatmaps.codeplex.com/
/// from http://code.google.com/intl/en-us/apis/maps/signup.html
/// </summary>
// Yahoo version strings
QString VersionYahooMap;
QString VersionYahooSatellite;
QString VersionYahooLabels;
// BingMaps
QString VersionBingMaps;
// YandexMap
QString VersionYandexMap;
/// <summary>
/// Bing Maps Customer Identification, more info here
/// http://msdn.microsoft.com/en-us/library/bb924353.aspx
/// </summary>
QString BingMapsClientToken;
};
class UrlFactory : public QObject, public ProviderStrings {
Q_OBJECT
public:
QByteArray UserAgent;
QNetworkProxy Proxy;
UrlFactory();
~UrlFactory();
QString makeImageUrl (const MapType &type, const QPoint &pos, const int &zoom, const QString &language);
private:
void _getSecGoogleWords (const QPoint &pos, QString &sec1, QString &sec2);
int _getServerNum (const QPoint& pos, const int &max) const;
void _tryCorrectGoogleVersions ();
QString _tileXYToQuadKey (const int &tileX, const int &tileY, const int &levelOfDetail) const;
bool _isCorrectedGoogleVersions;
bool _correctGoogleVersions;
int _timeout;
QMutex mutex;
static const double EarthRadiusKm;
};
}
#endif // FOO_H
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include <QtPositioning/QGeoRectangle> #include <QtPositioning/QGeoRectangle>
#include <unordered_map> #include <unordered_map>
#include "qgeocodereplygoogle.h" #include "qgeocodereplyqgc.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
...@@ -156,7 +156,7 @@ QSet<int> JasonMonger::json2QGeoCodeTypeGoogle(const QJsonArray &types) { ...@@ -156,7 +156,7 @@ QSet<int> JasonMonger::json2QGeoCodeTypeGoogle(const QJsonArray &types) {
JasonMonger kMonger; JasonMonger kMonger;
QGeoCodeReplyGoogle::QGeoCodeReplyGoogle(QNetworkReply *reply, QObject *parent) QGeoCodeReplyQGC::QGeoCodeReplyQGC(QNetworkReply *reply, QObject *parent)
: QGeoCodeReply(parent), m_reply(reply) : QGeoCodeReply(parent), m_reply(reply)
{ {
connect(m_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); connect(m_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished()));
...@@ -167,13 +167,13 @@ QGeoCodeReplyGoogle::QGeoCodeReplyGoogle(QNetworkReply *reply, QObject *parent) ...@@ -167,13 +167,13 @@ QGeoCodeReplyGoogle::QGeoCodeReplyGoogle(QNetworkReply *reply, QObject *parent)
setOffset(0); setOffset(0);
} }
QGeoCodeReplyGoogle::~QGeoCodeReplyGoogle() QGeoCodeReplyQGC::~QGeoCodeReplyQGC()
{ {
if (m_reply) if (m_reply)
m_reply->deleteLater(); m_reply->deleteLater();
} }
void QGeoCodeReplyGoogle::abort() void QGeoCodeReplyQGC::abort()
{ {
if (!m_reply) if (!m_reply)
return; return;
...@@ -184,7 +184,7 @@ void QGeoCodeReplyGoogle::abort() ...@@ -184,7 +184,7 @@ void QGeoCodeReplyGoogle::abort()
m_reply = 0; m_reply = 0;
} }
void QGeoCodeReplyGoogle::networkReplyFinished() void QGeoCodeReplyQGC::networkReplyFinished()
{ {
if (!m_reply) if (!m_reply)
return; return;
...@@ -288,7 +288,7 @@ void QGeoCodeReplyGoogle::networkReplyFinished() ...@@ -288,7 +288,7 @@ void QGeoCodeReplyGoogle::networkReplyFinished()
m_reply = 0; m_reply = 0;
} }
void QGeoCodeReplyGoogle::networkReplyError(QNetworkReply::NetworkError error) void QGeoCodeReplyQGC::networkReplyError(QNetworkReply::NetworkError error)
{ {
Q_UNUSED(error) Q_UNUSED(error)
if (!m_reply) if (!m_reply)
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QGeoCodeReplyGoogle : public QGeoCodeReply class QGeoCodeReplyQGC : public QGeoCodeReply
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QGeoCodeReplyGoogle(QNetworkReply *reply, QObject *parent = 0); explicit QGeoCodeReplyQGC(QNetworkReply *reply, QObject *parent = 0);
~QGeoCodeReplyGoogle(); ~QGeoCodeReplyQGC();
void abort(); void abort();
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
#include <QtPositioning/QGeoShape> #include <QtPositioning/QGeoShape>
#include <QtPositioning/QGeoRectangle> #include <QtPositioning/QGeoRectangle>
#include "qgeocodingmanagerenginegoogle.h" #include "qgeocodingmanagerengineqgc.h"
#include "qgeocodereplygoogle.h" #include "qgeocodereplyqgc.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
...@@ -77,7 +77,7 @@ static QString boundingBoxToLtrb(const QGeoRectangle &rect) ...@@ -77,7 +77,7 @@ static QString boundingBoxToLtrb(const QGeoRectangle &rect)
QString::number(rect.bottomRight().latitude()); QString::number(rect.bottomRight().latitude());
} }
QGeoCodingManagerEngineGoogle::QGeoCodingManagerEngineGoogle( QGeoCodingManagerEngineQGC::QGeoCodingManagerEngineQGC(
const QVariantMap &parameters, const QVariantMap &parameters,
QGeoServiceProvider::Error *error, QGeoServiceProvider::Error *error,
QString *errorString) QString *errorString)
...@@ -91,16 +91,16 @@ QGeoCodingManagerEngineGoogle::QGeoCodingManagerEngineGoogle( ...@@ -91,16 +91,16 @@ QGeoCodingManagerEngineGoogle::QGeoCodingManagerEngineGoogle(
errorString->clear(); errorString->clear();
} }
QGeoCodingManagerEngineGoogle::~QGeoCodingManagerEngineGoogle() QGeoCodingManagerEngineQGC::~QGeoCodingManagerEngineQGC()
{ {
} }
QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QGeoAddress &address, const QGeoShape &bounds) QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QGeoAddress &address, const QGeoShape &bounds)
{ {
return geocode(addressToQuery(address), -1, -1, bounds); return geocode(addressToQuery(address), -1, -1, bounds);
} }
QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QString &address, int limit, int offset, const QGeoShape &bounds) QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QString &address, int limit, int offset, const QGeoShape &bounds)
{ {
Q_UNUSED(limit); Q_UNUSED(limit);
Q_UNUSED(offset); Q_UNUSED(offset);
...@@ -124,7 +124,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QString &address, in ...@@ -124,7 +124,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QString &address, in
QNetworkReply *reply = m_networkManager->get(request); QNetworkReply *reply = m_networkManager->get(request);
reply->setParent(0); reply->setParent(0);
QGeoCodeReplyGoogle *geocodeReply = new QGeoCodeReplyGoogle(reply); QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply);
connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished()));
connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)),
...@@ -133,7 +133,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QString &address, in ...@@ -133,7 +133,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::geocode(const QString &address, in
return geocodeReply; return geocodeReply;
} }
QGeoCodeReply *QGeoCodingManagerEngineGoogle::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) QGeoCodeReply *QGeoCodingManagerEngineQGC::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds)
{ {
Q_UNUSED(bounds) Q_UNUSED(bounds)
...@@ -155,7 +155,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::reverseGeocode(const QGeoCoordinat ...@@ -155,7 +155,7 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::reverseGeocode(const QGeoCoordinat
QNetworkReply *reply = m_networkManager->get(request); QNetworkReply *reply = m_networkManager->get(request);
reply->setParent(0); reply->setParent(0);
QGeoCodeReplyGoogle *geocodeReply = new QGeoCodeReplyGoogle(reply); QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply);
connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished()));
connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)),
...@@ -164,14 +164,14 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::reverseGeocode(const QGeoCoordinat ...@@ -164,14 +164,14 @@ QGeoCodeReply *QGeoCodingManagerEngineGoogle::reverseGeocode(const QGeoCoordinat
return geocodeReply; return geocodeReply;
} }
void QGeoCodingManagerEngineGoogle::replyFinished() void QGeoCodingManagerEngineQGC::replyFinished()
{ {
QGeoCodeReply *reply = qobject_cast<QGeoCodeReply *>(sender()); QGeoCodeReply *reply = qobject_cast<QGeoCodeReply *>(sender());
if (reply) if (reply)
emit finished(reply); emit finished(reply);
} }
void QGeoCodingManagerEngineGoogle::replyError(QGeoCodeReply::Error errorCode, const QString &errorString) void QGeoCodingManagerEngineQGC::replyError(QGeoCodeReply::Error errorCode, const QString &errorString)
{ {
QGeoCodeReply *reply = qobject_cast<QGeoCodeReply *>(sender()); QGeoCodeReply *reply = qobject_cast<QGeoCodeReply *>(sender());
if (reply) if (reply)
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -55,13 +55,13 @@ QT_BEGIN_NAMESPACE ...@@ -55,13 +55,13 @@ QT_BEGIN_NAMESPACE
class QNetworkAccessManager; class QNetworkAccessManager;
class QGeoCodingManagerEngineGoogle : public QGeoCodingManagerEngine class QGeoCodingManagerEngineQGC : public QGeoCodingManagerEngine
{ {
Q_OBJECT Q_OBJECT
public: public:
QGeoCodingManagerEngineGoogle(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString); QGeoCodingManagerEngineQGC(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString);
~QGeoCodingManagerEngineGoogle(); ~QGeoCodingManagerEngineQGC();
QGeoCodeReply* geocode (const QGeoAddress &address, const QGeoShape &bounds) Q_DECL_OVERRIDE; QGeoCodeReply* geocode (const QGeoAddress &address, const QGeoShape &bounds) Q_DECL_OVERRIDE;
QGeoCodeReply* geocode (const QString &address, int limit, int offset, const QGeoShape &bounds) Q_DECL_OVERRIDE; QGeoCodeReply* geocode (const QString &address, int limit, int offset, const QGeoShape &bounds) Q_DECL_OVERRIDE;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -46,9 +46,10 @@ ...@@ -46,9 +46,10 @@
#include <QtLocation/private/qgeotilespec_p.h> #include <QtLocation/private/qgeotilespec_p.h>
#include "qgeomapreplygoogle.h" #include "qgeomapreplyqgc.h"
#include "OpenPilotMaps.h"
QGeoMapReplyGoogle::QGeoMapReplyGoogle(QNetworkReply *reply, const QGeoTileSpec &spec, QObject *parent) QGeoMapReplyQGC::QGeoMapReplyQGC(QNetworkReply *reply, const QGeoTileSpec &spec, QObject *parent)
: QGeoTiledMapReply(spec, parent) : QGeoTiledMapReply(spec, parent)
, m_reply(reply) , m_reply(reply)
{ {
...@@ -57,7 +58,7 @@ QGeoMapReplyGoogle::QGeoMapReplyGoogle(QNetworkReply *reply, const QGeoTileSpec ...@@ -57,7 +58,7 @@ QGeoMapReplyGoogle::QGeoMapReplyGoogle(QNetworkReply *reply, const QGeoTileSpec
connect(m_reply, SIGNAL(destroyed()), this, SLOT(replyDestroyed())); connect(m_reply, SIGNAL(destroyed()), this, SLOT(replyDestroyed()));
} }
QGeoMapReplyGoogle::~QGeoMapReplyGoogle() QGeoMapReplyQGC::~QGeoMapReplyQGC()
{ {
if (m_reply) { if (m_reply) {
m_reply->deleteLater(); m_reply->deleteLater();
...@@ -65,24 +66,24 @@ QGeoMapReplyGoogle::~QGeoMapReplyGoogle() ...@@ -65,24 +66,24 @@ QGeoMapReplyGoogle::~QGeoMapReplyGoogle()
} }
} }
void QGeoMapReplyGoogle::abort() void QGeoMapReplyQGC::abort()
{ {
if (!m_reply) if (!m_reply)
return; return;
m_reply->abort(); m_reply->abort();
} }
QNetworkReply *QGeoMapReplyGoogle::networkReply() const QNetworkReply *QGeoMapReplyQGC::networkReply() const
{ {
return m_reply; return m_reply;
} }
void QGeoMapReplyGoogle::replyDestroyed() void QGeoMapReplyQGC::replyDestroyed()
{ {
m_reply = 0; m_reply = 0;
} }
void QGeoMapReplyGoogle::networkReplyFinished() void QGeoMapReplyQGC::networkReplyFinished()
{ {
if (!m_reply) if (!m_reply)
return; return;
...@@ -90,24 +91,39 @@ void QGeoMapReplyGoogle::networkReplyFinished() ...@@ -90,24 +91,39 @@ void QGeoMapReplyGoogle::networkReplyFinished()
if (m_reply->error() != QNetworkReply::NoError) if (m_reply->error() != QNetworkReply::NoError)
return; return;
// qDebug() << "Map OK: " << m_reply->url().toString();
QByteArray a = m_reply->readAll(); QByteArray a = m_reply->readAll();
setMapImageData(a); setMapImageData(a);
if(tileSpec().mapId() > 0 && tileSpec().mapId() < 5) switch ((OpenPilot::MapType)tileSpec().mapId()) {
case OpenPilot::GoogleMap:
case OpenPilot::GoogleSatellite:
case OpenPilot::GoogleLabels:
case OpenPilot::GoogleTerrain:
case OpenPilot::GoogleHybrid:
case OpenPilot::BingMap:
setMapImageFormat("png"); setMapImageFormat("png");
else break;
case OpenPilot::BingSatellite:
setMapImageFormat("jpeg");
break;
default:
qWarning("Unknown map id %d", tileSpec().mapId()); qWarning("Unknown map id %d", tileSpec().mapId());
break;
}
setFinished(true); setFinished(true);
m_reply->deleteLater(); m_reply->deleteLater();
m_reply = 0; m_reply = 0;
} }
void QGeoMapReplyGoogle::networkReplyError(QNetworkReply::NetworkError error) void QGeoMapReplyQGC::networkReplyError(QNetworkReply::NetworkError error)
{ {
if (!m_reply) if (!m_reply)
return; return;
// qDebug() << "Map error: " << m_reply->url().toString();
if (error != QNetworkReply::OperationCanceledError) if (error != QNetworkReply::OperationCanceledError)
setError(QGeoTiledMapReply::CommunicationError, m_reply->errorString()); setError(QGeoTiledMapReply::CommunicationError, m_reply->errorString());
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
** $QT_END_LICENSE$ ** $QT_END_LICENSE$
** **
** 2015.4.4 ** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl ** Adapted for use with QGroundControl
** **
** Gus Grubba <mavlink@grubba.com> ** Gus Grubba <mavlink@grubba.com>
** **
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QGeoMapReplyGoogle : public QGeoTiledMapReply class QGeoMapReplyQGC : public QGeoTiledMapReply
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QGeoMapReplyGoogle(QNetworkReply *reply, const QGeoTileSpec &spec, QObject *parent = 0); explicit QGeoMapReplyQGC(QNetworkReply *reply, const QGeoTileSpec &spec, QObject *parent = 0);