Skip to content

Commit

Permalink
Merge pull request #2854 from dogmaphobic/flickableInOfflineMaps
Browse files Browse the repository at this point in the history
Flickable in Offline Maps
  • Loading branch information
dogmaphobic committed Feb 20, 2016
2 parents 9612617 + 74ff671 commit b4f0cd6
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 285 deletions.
6 changes: 3 additions & 3 deletions src/QtLocationPlugin/QGCMapTileSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ This file is part of the QGROUNDCONTROL project
*
*/

#include <math.h>
#include <QSettings>

#include "QGCMapEngine.h"
#include "QGCMapTileSet.h"
#include "QGCMapEngineManager.h"

#include <QSettings>
#include <math.h>

QGC_LOGGING_CATEGORY(QGCCachedTileSetLog, "QGCCachedTileSetLog")

#define TILE_BATCH_SIZE 256
Expand Down
4 changes: 2 additions & 2 deletions src/QtLocationPlugin/QGCMapUrlEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ This file is part of the QGROUNDCONTROL project
* Original work: The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
*/

#include "QGCMapEngine.h"

#include <QRegExp>
#include <QNetworkReply>
#include <QEventLoop>
#include <QTimer>
#include <QString>
#include <QByteArray>

#include "QGCMapEngine.h"

//-----------------------------------------------------------------------------
UrlFactory::UrlFactory()
: _timeout(5 * 1000)
Expand Down
6 changes: 3 additions & 3 deletions src/QtLocationPlugin/QGCTileCacheWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ This file is part of the QGROUNDCONTROL project
*
*/

#include "QGCMapEngine.h"
#include "QGCMapTileSet.h"

#include <QVariant>
#include <QtSql/QSqlQuery>
#include <QSqlError>
Expand All @@ -39,9 +42,6 @@ This file is part of the QGROUNDCONTROL project

#include "time.h"

#include "QGCMapEngine.h"
#include "QGCMapTileSet.h"

const char* kDefaultSet = "Default Tile Set";
const QString kSession = QLatin1String("QGeoTileWorkerSession");

Expand Down
12 changes: 6 additions & 6 deletions src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
**
****************************************************************************/

#include "QGeoCodeReplyQGC.h"

#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
Expand All @@ -54,8 +56,6 @@
#include <QSet>
#include <QDebug>

#include "QGeoCodeReplyQGC.h"

enum QGeoCodeTypeGoogle {
GeoCodeTypeUnknown,
StreetAddress, // indicates a precise street address.
Expand Down Expand Up @@ -193,7 +193,7 @@ void QGeoCodeReplyQGC::networkReplyFinished()

QJsonDocument document = QJsonDocument::fromJson(m_reply->readAll());
QJsonObject object = document.object();

if (object.value(QStringLiteral("status")) != QStringLiteral("OK")) {
QString error = object.value(QStringLiteral("status")).toString();
qWarning() << m_reply->url() << "returned" << error;
Expand All @@ -210,13 +210,13 @@ void QGeoCodeReplyQGC::networkReplyFinished()
continue;

QJsonObject geocode = results[i].toObject();

QGeoAddress address;
if (geocode.contains(QStringLiteral("formatted_address"))) {
address.setText(geocode.value(QStringLiteral("formatted_address")).toString());
}


if (geocode.contains(QStringLiteral("address_components"))) {
QJsonArray ac = geocode.value(QStringLiteral("address_components")).toArray();

Expand Down
9 changes: 4 additions & 5 deletions src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
**
****************************************************************************/

#include "QGeoCodingManagerEngineQGC.h"
#include "QGeoCodeReplyQGC.h"

#include <QtCore/QVariantMap>
#include <QtCore/QUrl>
#include <QtCore/QUrlQuery>
Expand All @@ -55,10 +58,6 @@
#include <QtPositioning/QGeoAddress>
#include <QtPositioning/QGeoShape>
#include <QtPositioning/QGeoRectangle>
#include <QDebug>

#include "QGeoCodingManagerEngineQGC.h"
#include "QGeoCodeReplyQGC.h"

static QString addressToQuery(const QGeoAddress &address)
{
Expand Down Expand Up @@ -120,7 +119,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QString &address, int l
url.setQuery(query);
request.setUrl(url);
//qDebug() << url;

QNetworkReply *reply = m_networkManager->get(request);
reply->setParent(0);

Expand Down
6 changes: 3 additions & 3 deletions src/QtLocationPlugin/QGeoMapReplyQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
**
****************************************************************************/

#include "QGCMapEngine.h"
#include "QGeoMapReplyQGC.h"

#include <QtLocation/private/qgeotilespec_p.h>
#include <QtNetwork/QNetworkAccessManager>
#include <QFile>

#include "QGCMapEngine.h"
#include "QGeoMapReplyQGC.h"

//-----------------------------------------------------------------------------
QGeoTiledMapReplyQGC::QGeoTiledMapReplyQGC(QNetworkAccessManager *networkManager, const QNetworkRequest &request, const QGeoTileSpec &spec, QObject *parent)
: QGeoTiledMapReply(spec, parent)
Expand Down
5 changes: 2 additions & 3 deletions src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@
**
****************************************************************************/

#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>

#include "qdebug.h"
#include "QGeoServiceProviderPluginQGC.h"
#include "QGeoTiledMappingManagerEngineQGC.h"
#include "QGeoCodingManagerEngineQGC.h"

#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>

Q_EXTERN_C Q_DECL_EXPORT const char *qt_plugin_query_metadata();
Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance();

Expand Down
8 changes: 4 additions & 4 deletions src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
**
****************************************************************************/

#include <QtCore/QLocale>
#include <QtNetwork/QNetworkRequest>
#include <QtLocation/private/qgeotilespec_p.h>

#include "QGCMapEngine.h"
#include "QGeoTileFetcherQGC.h"
#include "QGeoMapReplyQGC.h"

#include <QtCore/QLocale>
#include <QtNetwork/QNetworkRequest>
#include <QtLocation/private/qgeotilespec_p.h>

//-----------------------------------------------------------------------------
QGeoTileFetcherQGC::QGeoTileFetcherQGC(QGeoTiledMappingManagerEngine *parent)
: QGeoTileFetcher(parent)
Expand Down
8 changes: 4 additions & 4 deletions src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
**
****************************************************************************/

#include "QGCMapEngine.h"
#include "QGeoTiledMappingManagerEngineQGC.h"
#include "QGeoTileFetcherQGC.h"

#include <QtLocation/private/qgeocameracapabilities_p.h>
#include <QtLocation/private/qgeomaptype_p.h>
#if QT_VERSION < 0x050500
Expand All @@ -54,10 +58,6 @@
#include <QDir>
#include <QStandardPaths>

#include "QGCMapEngine.h"
#include "QGeoTiledMappingManagerEngineQGC.h"
#include "QGeoTileFetcherQGC.h"

#if QT_VERSION >= 0x050500
//-----------------------------------------------------------------------------
QGeoTiledMapQGC::QGeoTiledMapQGC(QGeoTiledMappingManagerEngine *engine, QObject *parent)
Expand Down
Loading

0 comments on commit b4f0cd6

Please sign in to comment.