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
eb0b6c05
Commit
eb0b6c05
authored
Feb 07, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
afc5c2c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
29 deletions
+18
-29
QGCMapEngineManager.cc
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
+14
-14
QGCMapEngineManager.h
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
+4
-15
No files found.
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
View file @
eb0b6c05
...
...
@@ -78,19 +78,19 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1,
_bottomRightLon
=
lon1
;
_minZoom
=
minZoom
;
_maxZoom
=
maxZoom
;
_totalSet
.
clear
();
_imageSet
.
clear
();
_elevationSet
.
clear
();
for
(
int
z
=
minZoom
;
z
<=
maxZoom
;
z
++
)
{
QGCTileSet
set
=
QGCMapEngine
::
getTileCount
(
z
,
lon0
,
lat0
,
lon1
,
lat1
,
mapType
);
_
total
Set
+=
set
;
_
image
Set
+=
set
;
}
if
(
_fetchElevation
)
{
QGCTileSet
set
=
QGCMapEngine
::
getTileCount
(
1
,
lon0
,
lat0
,
lon1
,
lat1
,
UrlFactory
::
AirmapElevation
);
_
total
Set
+=
set
;
_
elevation
Set
+=
set
;
}
emit
tileX0Changed
();
emit
tileX1Changed
();
emit
tileY0Changed
();
emit
tileY1Changed
();
emit
tileCountChanged
();
emit
tileSizeChanged
();
...
...
@@ -101,14 +101,14 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1,
QString
QGCMapEngineManager
::
tileCountStr
()
{
return
QGCMapEngine
::
numberToString
(
_
total
Set
.
tileCount
);
return
QGCMapEngine
::
numberToString
(
_
imageSet
.
tileCount
+
_elevation
Set
.
tileCount
);
}
//-----------------------------------------------------------------------------
QString
QGCMapEngineManager
::
tileSizeStr
()
{
return
QGCMapEngine
::
bigSizeToString
(
_
total
Set
.
tileSize
);
return
QGCMapEngine
::
bigSizeToString
(
_
imageSet
.
tileSize
+
_elevation
Set
.
tileSize
);
}
//-----------------------------------------------------------------------------
...
...
@@ -142,7 +142,7 @@ QGCMapEngineManager::_tileSetFetched(QGCCachedTileSet* tileSet)
void
QGCMapEngineManager
::
startDownload
(
const
QString
&
name
,
const
QString
&
mapType
)
{
if
(
_
total
Set
.
tileSize
)
{
if
(
_
image
Set
.
tileSize
)
{
QGCCachedTileSet
*
set
=
new
QGCCachedTileSet
(
name
);
set
->
setMapTypeStr
(
mapType
);
set
->
setTopleftLat
(
_topleftLat
);
...
...
@@ -151,8 +151,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType)
set
->
setBottomRightLon
(
_bottomRightLon
);
set
->
setMinZoom
(
_minZoom
);
set
->
setMaxZoom
(
_maxZoom
);
set
->
setTotalTileSize
(
_
total
Set
.
tileSize
);
set
->
setTotalTileCount
(
_
total
Set
.
tileCount
);
set
->
setTotalTileSize
(
_
image
Set
.
tileSize
);
set
->
setTotalTileCount
(
_
image
Set
.
tileCount
);
set
->
setType
(
QGCMapEngine
::
getTypeFromName
(
mapType
));
QGCCreateTileSetTask
*
task
=
new
QGCCreateTileSetTask
(
set
);
//-- Create Tile Set (it will also create a list of tiles to download)
...
...
@@ -171,8 +171,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType)
set
->
setBottomRightLon
(
_bottomRightLon
);
set
->
setMinZoom
(
1
);
set
->
setMaxZoom
(
1
);
set
->
setTotalTileSize
(
_
total
Set
.
tileSize
);
set
->
setTotalTileCount
(
_
total
Set
.
tileCount
);
set
->
setTotalTileSize
(
_
elevation
Set
.
tileSize
);
set
->
setTotalTileCount
(
_
elevation
Set
.
tileCount
);
set
->
setType
(
QGCMapEngine
::
getTypeFromName
(
"Airmap Elevation Data"
));
QGCCreateTileSetTask
*
task
=
new
QGCCreateTileSetTask
(
set
);
//-- Create Tile Set (it will also create a list of tiles to download)
...
...
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
View file @
eb0b6c05
...
...
@@ -37,10 +37,6 @@ public:
};
Q_ENUM
(
ImportAction
)
Q_PROPERTY
(
int
tileX0
READ
tileX0
NOTIFY
tileX0Changed
)
Q_PROPERTY
(
int
tileX1
READ
tileX1
NOTIFY
tileX1Changed
)
Q_PROPERTY
(
int
tileY0
READ
tileY0
NOTIFY
tileY0Changed
)
Q_PROPERTY
(
int
tileY1
READ
tileY1
NOTIFY
tileY1Changed
)
Q_PROPERTY
(
quint64
tileCount
READ
tileCount
NOTIFY
tileCountChanged
)
Q_PROPERTY
(
QString
tileCountStr
READ
tileCountStr
NOTIFY
tileCountChanged
)
Q_PROPERTY
(
quint64
tileSize
READ
tileSize
NOTIFY
tileSizeChanged
)
...
...
@@ -76,13 +72,9 @@ public:
Q_INVOKABLE
bool
importSets
(
QString
path
=
QString
());
Q_INVOKABLE
void
resetAction
();
int
tileX0
()
{
return
_totalSet
.
tileX0
;
}
int
tileX1
()
{
return
_totalSet
.
tileX1
;
}
int
tileY0
()
{
return
_totalSet
.
tileY0
;
}
int
tileY1
()
{
return
_totalSet
.
tileY1
;
}
quint64
tileCount
()
{
return
_totalSet
.
tileCount
;
}
quint64
tileCount
()
{
return
_imageSet
.
tileCount
+
_elevationSet
.
tileCount
;
}
QString
tileCountStr
();
quint64
tileSize
()
{
return
_
total
Set
.
tileSize
;
}
quint64
tileSize
()
{
return
_
imageSet
.
tileSize
+
_elevation
Set
.
tileSize
;
}
QString
tileSizeStr
();
QStringList
mapList
();
QmlObjectListModel
*
tileSets
()
{
return
&
_tileSets
;
}
...
...
@@ -108,10 +100,6 @@ public:
void
setToolbox
(
QGCToolbox
*
toolbox
);
signals:
void
tileX0Changed
();
void
tileX1Changed
();
void
tileY0Changed
();
void
tileY1Changed
();
void
tileCountChanged
();
void
tileSizeChanged
();
void
tileSetsChanged
();
...
...
@@ -141,7 +129,8 @@ private:
void
_updateDiskFreeSpace
();
private:
QGCTileSet
_totalSet
;
QGCTileSet
_imageSet
;
QGCTileSet
_elevationSet
;
double
_topleftLat
;
double
_topleftLon
;
double
_bottomRightLat
;
...
...
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