Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
47b00f2f
Commit
47b00f2f
authored
Apr 04, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Google Maps Qt Geoservices plugin.
parent
a2e9481b
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1599 additions
and
100 deletions
+1599
-100
.qmake.conf
libs/QtLocationGoogle/.qmake.conf
+3
-0
QtLocationGoogle.pro
libs/QtLocationGoogle/QtLocationGoogle.pro
+31
-0
google_maps_plugin.json
libs/QtLocationGoogle/google_maps_plugin.json
+11
-0
qgeocodereplygoogle.cpp
libs/QtLocationGoogle/src/qgeocodereplygoogle.cpp
+301
-0
qgeocodereplygoogle.h
libs/QtLocationGoogle/src/qgeocodereplygoogle.h
+75
-0
qgeocodingmanagerenginegoogle.cpp
libs/QtLocationGoogle/src/qgeocodingmanagerenginegoogle.cpp
+181
-0
qgeocodingmanagerenginegoogle.h
libs/QtLocationGoogle/src/qgeocodingmanagerenginegoogle.h
+81
-0
qgeomapreplygoogle.cpp
libs/QtLocationGoogle/src/qgeomapreplygoogle.cpp
+117
-0
qgeomapreplygoogle.h
libs/QtLocationGoogle/src/qgeomapreplygoogle.h
+78
-0
qgeoserviceproviderplugingoogle.cpp
.../QtLocationGoogle/src/qgeoserviceproviderplugingoogle.cpp
+82
-0
qgeoserviceproviderplugingoogle.h
libs/QtLocationGoogle/src/qgeoserviceproviderplugingoogle.h
+70
-0
qgeotiledmappingmanagerenginegoogle.cpp
...ocationGoogle/src/qgeotiledmappingmanagerenginegoogle.cpp
+157
-0
qgeotiledmappingmanagerenginegoogle.h
...tLocationGoogle/src/qgeotiledmappingmanagerenginegoogle.h
+66
-0
qgeotilefetchergoogle.cpp
libs/QtLocationGoogle/src/qgeotilefetchergoogle.cpp
+108
-0
qgeotilefetchergoogle.h
libs/QtLocationGoogle/src/qgeotilefetchergoogle.h
+75
-0
qgcsystem.pro
qgcsystem.pro
+42
-7
qgroundcontro.pro
qgroundcontro.pro
+26
-0
main.cc
src/main.cc
+8
-0
FlightDisplay.qml
src/ui/flightdisplay/FlightDisplay.qml
+82
-88
QGCFlightDisplay.cc
src/ui/flightdisplay/QGCFlightDisplay.cc
+3
-3
QGCFlightDisplay.h
src/ui/flightdisplay/QGCFlightDisplay.h
+2
-2
No files found.
libs/QtLocationGoogle/.qmake.conf
0 → 100644
View file @
47b00f2f
load
(
qt_build_config
)
MODULE_VERSION
=
5
.
4
.
1
libs/QtLocationGoogle/QtLocationGoogle.pro
0 → 100644
View file @
47b00f2f
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
libs/QtLocationGoogle/google_maps_plugin.json
0 → 100644
View file @
47b00f2f
{
"Keys"
:
[
"google-maps"
],
"Provider"
:
"google"
,
"Version"
:
100
,
"Experimental"
:
false
,
"Features"
:
[
"OnlineMappingFeature"
,
"OnlineGeocodingFeature"
,
"ReverseGeocodingFeature"
]
}
libs/QtLocationGoogle/src/qgeocodereplygoogle.cpp
0 → 100644
View file @
47b00f2f
This diff is collapsed.
Click to expand it.
libs/QtLocationGoogle/src/qgeocodereplygoogle.h
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#ifndef QGEOCODEREPLYGOOGLE_H
#define QGEOCODEREPLYGOOGLE_H
#include <QtNetwork/QNetworkReply>
#include <QtLocation/QGeoCodeReply>
QT_BEGIN_NAMESPACE
class
QGeoCodeReplyGoogle
:
public
QGeoCodeReply
{
Q_OBJECT
public:
explicit
QGeoCodeReplyGoogle
(
QNetworkReply
*
reply
,
QObject
*
parent
=
0
);
~
QGeoCodeReplyGoogle
();
void
abort
();
private
Q_SLOTS
:
void
networkReplyFinished
();
void
networkReplyError
(
QNetworkReply
::
NetworkError
error
);
private:
QNetworkReply
*
m_reply
;
};
QT_END_NAMESPACE
#endif // QGEOCODEREPLYGOOGLE_H
libs/QtLocationGoogle/src/qgeocodingmanagerenginegoogle.cpp
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#include <QtCore/QVariantMap>
#include <QtCore/QUrl>
#include <QtCore/QUrlQuery>
#include <QtCore/QLocale>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtPositioning/QGeoCoordinate>
#include <QtPositioning/QGeoAddress>
#include <QtPositioning/QGeoShape>
#include <QtPositioning/QGeoRectangle>
#include "qgeocodingmanagerenginegoogle.h"
#include "qgeocodereplygoogle.h"
QT_BEGIN_NAMESPACE
static
QString
addressToQuery
(
const
QGeoAddress
&
address
)
{
return
address
.
street
()
+
QStringLiteral
(
", "
)
+
address
.
district
()
+
QStringLiteral
(
", "
)
+
address
.
city
()
+
QStringLiteral
(
", "
)
+
address
.
state
()
+
QStringLiteral
(
", "
)
+
address
.
country
();
}
static
QString
boundingBoxToLtrb
(
const
QGeoRectangle
&
rect
)
{
return
QString
::
number
(
rect
.
topLeft
().
longitude
())
+
QLatin1Char
(
','
)
+
QString
::
number
(
rect
.
topLeft
().
latitude
())
+
QLatin1Char
(
','
)
+
QString
::
number
(
rect
.
bottomRight
().
longitude
())
+
QLatin1Char
(
','
)
+
QString
::
number
(
rect
.
bottomRight
().
latitude
());
}
QGeoCodingManagerEngineGoogle
::
QGeoCodingManagerEngineGoogle
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
)
:
QGeoCodingManagerEngine
(
parameters
),
m_networkManager
(
new
QNetworkAccessManager
(
this
))
{
if
(
parameters
.
contains
(
QStringLiteral
(
"useragent"
)))
m_userAgent
=
parameters
.
value
(
QStringLiteral
(
"useragent"
)).
toString
().
toLatin1
();
else
m_userAgent
=
"Qt Location based application"
;
*
error
=
QGeoServiceProvider
::
NoError
;
errorString
->
clear
();
}
QGeoCodingManagerEngineGoogle
::~
QGeoCodingManagerEngineGoogle
()
{
}
QGeoCodeReply
*
QGeoCodingManagerEngineGoogle
::
geocode
(
const
QGeoAddress
&
address
,
const
QGeoShape
&
bounds
)
{
return
geocode
(
addressToQuery
(
address
),
-
1
,
-
1
,
bounds
);
}
QGeoCodeReply
*
QGeoCodingManagerEngineGoogle
::
geocode
(
const
QString
&
address
,
int
limit
,
int
offset
,
const
QGeoShape
&
bounds
)
{
Q_UNUSED
(
limit
);
Q_UNUSED
(
offset
);
QNetworkRequest
request
;
request
.
setRawHeader
(
"User-Agent"
,
m_userAgent
);
QUrl
url
(
QStringLiteral
(
"http://maps.googleapis.com/maps/api/geocode/json"
));
QUrlQuery
query
;
query
.
addQueryItem
(
QStringLiteral
(
"sensor"
),
QStringLiteral
(
"false"
));
query
.
addQueryItem
(
QStringLiteral
(
"language"
),
locale
().
name
().
left
(
2
));
query
.
addQueryItem
(
QStringLiteral
(
"address"
),
address
);
if
(
bounds
.
type
()
==
QGeoShape
::
RectangleType
)
{
query
.
addQueryItem
(
QStringLiteral
(
"bounds"
),
boundingBoxToLtrb
(
bounds
));
}
url
.
setQuery
(
query
);
request
.
setUrl
(
url
);
qDebug
()
<<
url
;
QNetworkReply
*
reply
=
m_networkManager
->
get
(
request
);
reply
->
setParent
(
0
);
QGeoCodeReplyGoogle
*
geocodeReply
=
new
QGeoCodeReplyGoogle
(
reply
);
connect
(
geocodeReply
,
SIGNAL
(
finished
()),
this
,
SLOT
(
replyFinished
()));
connect
(
geocodeReply
,
SIGNAL
(
error
(
QGeoCodeReply
::
Error
,
QString
)),
this
,
SLOT
(
replyError
(
QGeoCodeReply
::
Error
,
QString
)));
return
geocodeReply
;
}
QGeoCodeReply
*
QGeoCodingManagerEngineGoogle
::
reverseGeocode
(
const
QGeoCoordinate
&
coordinate
,
const
QGeoShape
&
bounds
)
{
Q_UNUSED
(
bounds
)
QNetworkRequest
request
;
request
.
setRawHeader
(
"User-Agent"
,
m_userAgent
);
QUrl
url
(
QStringLiteral
(
"http://maps.googleapis.com/maps/api/geocode/json"
));
QUrlQuery
query
;
query
.
addQueryItem
(
QStringLiteral
(
"sensor"
),
QStringLiteral
(
"false"
));
query
.
addQueryItem
(
QStringLiteral
(
"language"
),
locale
().
name
().
left
(
2
));
query
.
addQueryItem
(
QStringLiteral
(
"latlng"
),
QStringLiteral
(
"%1,%2"
)
.
arg
(
coordinate
.
latitude
())
.
arg
(
coordinate
.
longitude
()));
url
.
setQuery
(
query
);
request
.
setUrl
(
url
);
qDebug
()
<<
url
;
QNetworkReply
*
reply
=
m_networkManager
->
get
(
request
);
reply
->
setParent
(
0
);
QGeoCodeReplyGoogle
*
geocodeReply
=
new
QGeoCodeReplyGoogle
(
reply
);
connect
(
geocodeReply
,
SIGNAL
(
finished
()),
this
,
SLOT
(
replyFinished
()));
connect
(
geocodeReply
,
SIGNAL
(
error
(
QGeoCodeReply
::
Error
,
QString
)),
this
,
SLOT
(
replyError
(
QGeoCodeReply
::
Error
,
QString
)));
return
geocodeReply
;
}
void
QGeoCodingManagerEngineGoogle
::
replyFinished
()
{
QGeoCodeReply
*
reply
=
qobject_cast
<
QGeoCodeReply
*>
(
sender
());
if
(
reply
)
emit
finished
(
reply
);
}
void
QGeoCodingManagerEngineGoogle
::
replyError
(
QGeoCodeReply
::
Error
errorCode
,
const
QString
&
errorString
)
{
QGeoCodeReply
*
reply
=
qobject_cast
<
QGeoCodeReply
*>
(
sender
());
if
(
reply
)
emit
error
(
reply
,
errorCode
,
errorString
);
}
QT_END_NAMESPACE
libs/QtLocationGoogle/src/qgeocodingmanagerenginegoogle.h
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#ifndef QGEOCODINGMANAGERENGINEGOOGLE_H
#define QGEOCODINGMANAGERENGINEGOOGLE_H
#include <QtLocation/QGeoServiceProvider>
#include <QtLocation/QGeoCodingManagerEngine>
#include <QtLocation/QGeoCodeReply>
QT_BEGIN_NAMESPACE
class
QNetworkAccessManager
;
class
QGeoCodingManagerEngineGoogle
:
public
QGeoCodingManagerEngine
{
Q_OBJECT
public:
QGeoCodingManagerEngineGoogle
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
);
~
QGeoCodingManagerEngineGoogle
();
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
*
reverseGeocode
(
const
QGeoCoordinate
&
coordinate
,
const
QGeoShape
&
bounds
)
Q_DECL_OVERRIDE
;
private
Q_SLOTS
:
void
replyFinished
();
void
replyError
(
QGeoCodeReply
::
Error
errorCode
,
const
QString
&
errorString
);
private:
QNetworkAccessManager
*
m_networkManager
;
QByteArray
m_userAgent
;
};
QT_END_NAMESPACE
#endif // QGEOCODINGMANAGERENGINEGOOGLE_H
libs/QtLocationGoogle/src/qgeomapreplygoogle.cpp
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#include <QtLocation/private/qgeotilespec_p.h>
#include "qgeomapreplygoogle.h"
QGeoMapReplyGoogle
::
QGeoMapReplyGoogle
(
QNetworkReply
*
reply
,
const
QGeoTileSpec
&
spec
,
QObject
*
parent
)
:
QGeoTiledMapReply
(
spec
,
parent
)
,
m_reply
(
reply
)
{
connect
(
m_reply
,
SIGNAL
(
finished
()),
this
,
SLOT
(
networkReplyFinished
()));
connect
(
m_reply
,
SIGNAL
(
error
(
QNetworkReply
::
NetworkError
)),
this
,
SLOT
(
networkReplyError
(
QNetworkReply
::
NetworkError
)));
connect
(
m_reply
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
replyDestroyed
()));
}
QGeoMapReplyGoogle
::~
QGeoMapReplyGoogle
()
{
if
(
m_reply
)
{
m_reply
->
deleteLater
();
m_reply
=
0
;
}
}
void
QGeoMapReplyGoogle
::
abort
()
{
if
(
!
m_reply
)
return
;
m_reply
->
abort
();
}
QNetworkReply
*
QGeoMapReplyGoogle
::
networkReply
()
const
{
return
m_reply
;
}
void
QGeoMapReplyGoogle
::
replyDestroyed
()
{
m_reply
=
0
;
}
void
QGeoMapReplyGoogle
::
networkReplyFinished
()
{
if
(
!
m_reply
)
return
;
if
(
m_reply
->
error
()
!=
QNetworkReply
::
NoError
)
return
;
QByteArray
a
=
m_reply
->
readAll
();
setMapImageData
(
a
);
if
(
tileSpec
().
mapId
()
>
0
&&
tileSpec
().
mapId
()
<
5
)
setMapImageFormat
(
"png"
);
else
qWarning
(
"Unknown map id %d"
,
tileSpec
().
mapId
());
setFinished
(
true
);
m_reply
->
deleteLater
();
m_reply
=
0
;
}
void
QGeoMapReplyGoogle
::
networkReplyError
(
QNetworkReply
::
NetworkError
error
)
{
if
(
!
m_reply
)
return
;
if
(
error
!=
QNetworkReply
::
OperationCanceledError
)
setError
(
QGeoTiledMapReply
::
CommunicationError
,
m_reply
->
errorString
());
setFinished
(
true
);
m_reply
->
deleteLater
();
m_reply
=
0
;
}
libs/QtLocationGoogle/src/qgeomapreplygoogle.h
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#ifndef QGEOMAPREPLYGOOGLE_H
#define QGEOMAPREPLYGOOGLE_H
#include <QtNetwork/QNetworkReply>
#include <QtLocation/private/qgeotiledmapreply_p.h>
QT_BEGIN_NAMESPACE
class
QGeoMapReplyGoogle
:
public
QGeoTiledMapReply
{
Q_OBJECT
public:
explicit
QGeoMapReplyGoogle
(
QNetworkReply
*
reply
,
const
QGeoTileSpec
&
spec
,
QObject
*
parent
=
0
);
~
QGeoMapReplyGoogle
();
void
abort
();
QNetworkReply
*
networkReply
()
const
;
private
Q_SLOTS
:
void
replyDestroyed
();
void
networkReplyFinished
();
void
networkReplyError
(
QNetworkReply
::
NetworkError
error
);
private:
QNetworkReply
*
m_reply
;
};
QT_END_NAMESPACE
#endif // QGEOMAPREPLYGOOGLE_H
libs/QtLocationGoogle/src/qgeoserviceproviderplugingoogle.cpp
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
** 2015.4.4
** Adapted for google maps with the intent of use for QGroundControl
**
** Gus Grubba <mavlink@grubba.com>
**
****************************************************************************/
#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>
#include "qdebug.h"
#include "qgeoserviceproviderplugingoogle.h"
#include "qgeotiledmappingmanagerenginegoogle.h"
#include "qgeocodingmanagerenginegoogle.h"
QT_BEGIN_NAMESPACE
QGeoCodingManagerEngine
*
QGeoServiceProviderFactoryGoogle
::
createGeocodingManagerEngine
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
)
const
{
return
new
QGeoCodingManagerEngineGoogle
(
parameters
,
error
,
errorString
);
}
QGeoMappingManagerEngine
*
QGeoServiceProviderFactoryGoogle
::
createMappingManagerEngine
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
)
const
{
return
new
QGeoTiledMappingManagerEngineGoogle
(
parameters
,
error
,
errorString
);
}
QGeoRoutingManagerEngine
*
QGeoServiceProviderFactoryGoogle
::
createRoutingManagerEngine
(
const
QVariantMap
&
,
QGeoServiceProvider
::
Error
*
,
QString
*
)
const
{
// Not implemented for QGC
return
NULL
;
}
QPlaceManagerEngine
*
QGeoServiceProviderFactoryGoogle
::
createPlaceManagerEngine
(
const
QVariantMap
&
,
QGeoServiceProvider
::
Error
*
,
QString
*
)
const
{
// Not implemented for QGC
return
NULL
;
}
QT_END_NAMESPACE
libs/QtLocationGoogle/src/qgeoserviceproviderplugingoogle.h
0 → 100644
View file @
47b00f2f
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**