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
cb62d3ae
Unverified
Commit
cb62d3ae
authored
Jul 11, 2020
by
Don Gagne
Committed by
GitHub
Jul 11, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8902 from DonLakeFlyer/ZoomTo23
Support map zoom to level 23
parents
5db0b39b
b7dfacba
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
13 deletions
+45
-13
ChangeLog.md
ChangeLog.md
+1
-0
qgcresources.qrc
qgcresources.qrc
+1
-0
BingNoTileBytes.dat
resources/BingNoTileBytes.dat
+0
-0
BingMapProvider.h
src/QtLocationPlugin/BingMapProvider.h
+3
-0
MapProvider.cpp
src/QtLocationPlugin/MapProvider.cpp
+0
-4
MapProvider.h
src/QtLocationPlugin/MapProvider.h
+2
-1
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+11
-0
QGCMapUrlEngine.h
src/QtLocationPlugin/QGCMapUrlEngine.h
+2
-1
QGeoMapReplyQGC.cpp
src/QtLocationPlugin/QGeoMapReplyQGC.cpp
+24
-7
QGeoMapReplyQGC.h
src/QtLocationPlugin/QGeoMapReplyQGC.h
+1
-0
No files found.
ChangeLog.md
View file @
cb62d3ae
...
@@ -4,6 +4,7 @@ Note: This file only contains high level features or important fixes.
...
@@ -4,6 +4,7 @@ Note: This file only contains high level features or important fixes.
## 4.1 - Daily build
## 4.1 - Daily build
*
Maps: Support zoom up to level 23 even if map provider doesn't provide tiles that high
*
Settings/Mavlink: Add ability to forward mavlink traffic out specified UDP port
*
Settings/Mavlink: Add ability to forward mavlink traffic out specified UDP port
*
Support mavlink terrain protocol which queries gcs for terrain height information. Allows planning missions with TERRAIN
\_
FRAME.
*
Support mavlink terrain protocol which queries gcs for terrain height information. Allows planning missions with TERRAIN
\_
FRAME.
*
Fly: New instrument values display/editing support
*
Fly: New instrument values display/editing support
...
...
qgcresources.qrc
View file @
cb62d3ae
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
<file alias="gear-black.svg">resources/gear-black.svg</file>
<file alias="gear-black.svg">resources/gear-black.svg</file>
<file alias="gear-white.svg">resources/gear-white.svg</file>
<file alias="gear-white.svg">resources/gear-white.svg</file>
<file alias="helicoptericon.svg">resources/helicoptericon.svg</file>
<file alias="helicoptericon.svg">resources/helicoptericon.svg</file>
<file alias="BingNoTileBytes.dat">resources/BingNoTileBytes.dat</file>
<file alias="JoystickBezel.png">resources/JoystickBezel.png</file>
<file alias="JoystickBezel.png">resources/JoystickBezel.png</file>
<file alias="JoystickBezelLight.png">resources/JoystickBezelLight.png</file>
<file alias="JoystickBezelLight.png">resources/JoystickBezelLight.png</file>
<file alias="land.svg">resources/land.svg</file>
<file alias="land.svg">resources/land.svg</file>
...
...
resources/BingNoTileBytes.dat
0 → 100644
View file @
cb62d3ae
File added
src/QtLocationPlugin/BingMapProvider.h
View file @
cb62d3ae
...
@@ -20,6 +20,9 @@ public:
...
@@ -20,6 +20,9 @@ public:
~
BingMapProvider
()
=
default
;
~
BingMapProvider
()
=
default
;
bool
_isBingProvider
()
const
override
{
return
true
;
}
protected:
protected:
const
QString
_versionBingMaps
=
QStringLiteral
(
"563"
);
const
QString
_versionBingMaps
=
QStringLiteral
(
"563"
);
};
};
...
...
src/QtLocationPlugin/MapProvider.cpp
View file @
cb62d3ae
...
@@ -89,10 +89,6 @@ int MapProvider::lat2tileY(const double lat, const int z) const {
...
@@ -89,10 +89,6 @@ int MapProvider::lat2tileY(const double lat, const int z) const {
2.0
*
pow
(
2.0
,
z
)));
2.0
*
pow
(
2.0
,
z
)));
}
}
bool
MapProvider
::
_isElevationProvider
()
const
{
return
false
;
}
QGCTileSet
MapProvider
::
getTileCount
(
const
int
zoom
,
const
double
topleftLon
,
QGCTileSet
MapProvider
::
getTileCount
(
const
int
zoom
,
const
double
topleftLon
,
const
double
topleftLat
,
const
double
bottomRightLon
,
const
double
topleftLat
,
const
double
bottomRightLon
,
const
double
bottomRightLat
)
const
{
const
double
bottomRightLat
)
const
{
...
...
src/QtLocationPlugin/MapProvider.h
View file @
cb62d3ae
...
@@ -45,7 +45,8 @@ public:
...
@@ -45,7 +45,8 @@ public:
virtual
int
lat2tileY
(
const
double
lat
,
const
int
z
)
const
;
virtual
int
lat2tileY
(
const
double
lat
,
const
int
z
)
const
;
virtual
bool
_isElevationProvider
()
const
;
virtual
bool
_isElevationProvider
()
const
{
return
false
;
}
virtual
bool
_isBingProvider
()
const
{
return
false
;
}
virtual
QGCTileSet
getTileCount
(
const
int
zoom
,
const
double
topleftLon
,
virtual
QGCTileSet
getTileCount
(
const
int
zoom
,
const
double
topleftLon
,
const
double
topleftLat
,
const
double
bottomRightLon
,
const
double
topleftLat
,
const
double
bottomRightLon
,
...
...
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
cb62d3ae
...
@@ -155,6 +155,17 @@ QString UrlFactory::getTypeFromId(int id) {
...
@@ -155,6 +155,17 @@ QString UrlFactory::getTypeFromId(int id) {
return
""
;
return
""
;
}
}
MapProvider
*
UrlFactory
::
getMapProviderFromId
(
int
id
)
{
QString
type
=
getTypeFromId
(
id
);
if
(
!
type
.
isEmpty
())
{
if
(
_providersTable
.
find
(
type
)
!=
_providersTable
.
end
())
{
return
_providersTable
[
type
];
}
}
return
nullptr
;
}
// Todo : qHash produce a uint bigger than max(int)
// Todo : qHash produce a uint bigger than max(int)
// There is still a low probability for this to
// There is still a low probability for this to
// generate similar hash for different types
// generate similar hash for different types
...
...
src/QtLocationPlugin/QGCMapUrlEngine.h
View file @
cb62d3ae
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "MapboxMapProvider.h"
#include "MapboxMapProvider.h"
#include "ElevationMapProvider.h"
#include "ElevationMapProvider.h"
#define MAX_MAP_ZOOM (2
0
.0)
#define MAX_MAP_ZOOM (2
3
.0)
class
UrlFactory
:
public
QObject
{
class
UrlFactory
:
public
QObject
{
Q_OBJECT
Q_OBJECT
...
@@ -48,6 +48,7 @@ public:
...
@@ -48,6 +48,7 @@ public:
int
getIdFromType
(
QString
type
);
int
getIdFromType
(
QString
type
);
QString
getTypeFromId
(
int
id
);
QString
getTypeFromId
(
int
id
);
MapProvider
*
getMapProviderFromId
(
int
id
);
QGCTileSet
getTileCount
(
int
zoom
,
double
topleftLon
,
double
topleftLat
,
QGCTileSet
getTileCount
(
int
zoom
,
double
topleftLon
,
double
topleftLat
,
double
bottomRightLon
,
double
bottomRightLat
,
double
bottomRightLon
,
double
bottomRightLat
,
...
...
src/QtLocationPlugin/QGeoMapReplyQGC.cpp
View file @
cb62d3ae
...
@@ -53,7 +53,8 @@
...
@@ -53,7 +53,8 @@
#include <QFile>
#include <QFile>
#include "TerrainTile.h"
#include "TerrainTile.h"
int
QGeoTiledMapReplyQGC
::
_requestCount
=
0
;
int
QGeoTiledMapReplyQGC
::
_requestCount
=
0
;
QByteArray
QGeoTiledMapReplyQGC
::
_bingNoTileImage
;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
QGeoTiledMapReplyQGC
::
QGeoTiledMapReplyQGC
(
QNetworkAccessManager
*
networkManager
,
const
QNetworkRequest
&
request
,
const
QGeoTileSpec
&
spec
,
QObject
*
parent
)
QGeoTiledMapReplyQGC
::
QGeoTiledMapReplyQGC
(
QNetworkAccessManager
*
networkManager
,
const
QNetworkRequest
&
request
,
const
QGeoTileSpec
&
spec
,
QObject
*
parent
)
...
@@ -62,6 +63,12 @@ QGeoTiledMapReplyQGC::QGeoTiledMapReplyQGC(QNetworkAccessManager *networkManager
...
@@ -62,6 +63,12 @@ QGeoTiledMapReplyQGC::QGeoTiledMapReplyQGC(QNetworkAccessManager *networkManager
,
_request
(
request
)
,
_request
(
request
)
,
_networkManager
(
networkManager
)
,
_networkManager
(
networkManager
)
{
{
if
(
_bingNoTileImage
.
count
()
==
0
)
{
QFile
file
(
":/res/BingNoTileBytes.dat"
);
file
.
open
(
QFile
::
ReadOnly
);
_bingNoTileImage
=
file
.
readAll
();
file
.
close
();
}
if
(
_request
.
url
().
isEmpty
())
{
if
(
_request
.
url
().
isEmpty
())
{
if
(
!
_badMapbox
.
size
())
{
if
(
!
_badMapbox
.
size
())
{
QFile
b
(
":/res/notile.png"
);
QFile
b
(
":/res/notile.png"
);
...
@@ -122,7 +129,8 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
...
@@ -122,7 +129,8 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
return
;
return
;
}
}
QByteArray
a
=
_reply
->
readAll
();
QByteArray
a
=
_reply
->
readAll
();
QString
format
=
getQGCMapEngine
()
->
urlFactory
()
->
getImageFormat
(
tileSpec
().
mapId
(),
a
);
UrlFactory
*
urlFactory
=
getQGCMapEngine
()
->
urlFactory
();
QString
format
=
urlFactory
->
getImageFormat
(
tileSpec
().
mapId
(),
a
);
//-- Test for a specialized, elevation data (not map tile)
//-- Test for a specialized, elevation data (not map tile)
if
(
getQGCMapEngine
()
->
urlFactory
()
->
isElevation
(
tileSpec
().
mapId
())){
if
(
getQGCMapEngine
()
->
urlFactory
()
->
isElevation
(
tileSpec
().
mapId
())){
a
=
TerrainTile
::
serialize
(
a
);
a
=
TerrainTile
::
serialize
(
a
);
...
@@ -135,11 +143,20 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
...
@@ -135,11 +143,20 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
}
}
emit
terrainDone
(
a
,
QNetworkReply
::
NoError
);
emit
terrainDone
(
a
,
QNetworkReply
::
NoError
);
}
else
{
}
else
{
//-- This is a map tile. Process and cache it if valid.
MapProvider
*
mapProvider
=
urlFactory
->
getMapProviderFromId
(
tileSpec
().
mapId
());
setMapImageData
(
a
);
if
(
mapProvider
&&
mapProvider
->
_isBingProvider
()
&&
a
.
size
()
&&
_bingNoTileImage
.
size
()
&&
a
==
_bingNoTileImage
)
{
if
(
!
format
.
isEmpty
())
{
// Bing doesn't return an error if you request a tile above supported zoom level
setMapImageFormat
(
format
);
// It instead returns an image of a missing tile graphic. We need to detect that
getQGCMapEngine
()
->
cacheTile
(
getQGCMapEngine
()
->
urlFactory
()
->
getTypeFromId
(
tileSpec
().
mapId
()),
tileSpec
().
x
(),
tileSpec
().
y
(),
tileSpec
().
zoom
(),
a
,
format
);
// and error out so Qt will deal with zooming correctly even if it doesn't have the tile.
// This allows us to zoom up to level 23 even though the tiles don't actually exist
setError
(
QGeoTiledMapReply
::
CommunicationError
,
"Bing tile above zoom level"
);
}
else
{
//-- This is a map tile. Process and cache it if valid.
setMapImageData
(
a
);
if
(
!
format
.
isEmpty
())
{
setMapImageFormat
(
format
);
getQGCMapEngine
()
->
cacheTile
(
getQGCMapEngine
()
->
urlFactory
()
->
getTypeFromId
(
tileSpec
().
mapId
()),
tileSpec
().
x
(),
tileSpec
().
y
(),
tileSpec
().
zoom
(),
a
,
format
);
}
}
}
setFinished
(
true
);
setFinished
(
true
);
}
}
...
...
src/QtLocationPlugin/QGeoMapReplyQGC.h
View file @
cb62d3ae
...
@@ -81,6 +81,7 @@ private:
...
@@ -81,6 +81,7 @@ private:
QByteArray
_badMapbox
;
QByteArray
_badMapbox
;
QByteArray
_badTile
;
QByteArray
_badTile
;
QTimer
_timer
;
QTimer
_timer
;
static
QByteArray
_bingNoTileImage
;
static
int
_requestCount
;
static
int
_requestCount
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment