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
cf6089d0
Commit
cf6089d0
authored
Jul 28, 2018
by
stmoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the bug in case of non-supported level
parent
9d9276b2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+10
-3
QGeoTileFetcherQGC.cpp
src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
+6
-1
No files found.
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
cf6089d0
...
@@ -147,8 +147,9 @@ UrlFactory::getTileURL(MapType type, int x, int y, int zoom, QNetworkAccessManag
...
@@ -147,8 +147,9 @@ UrlFactory::getTileURL(MapType type, int x, int y, int zoom, QNetworkAccessManag
//-- Build URL
//-- Build URL
QNetworkRequest
request
;
QNetworkRequest
request
;
QString
url
=
_getURL
(
type
,
x
,
y
,
zoom
,
networkManager
);
QString
url
=
_getURL
(
type
,
x
,
y
,
zoom
,
networkManager
);
if
(
url
.
isEmpty
())
if
(
url
.
isEmpty
())
{
return
request
;
return
request
;
}
request
.
setUrl
(
QUrl
(
url
));
request
.
setUrl
(
QUrl
(
url
));
request
.
setRawHeader
(
"Accept"
,
"*/*"
);
request
.
setRawHeader
(
"Accept"
,
"*/*"
);
switch
(
type
)
{
switch
(
type
)
{
...
@@ -433,7 +434,10 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
...
@@ -433,7 +434,10 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
if
(
zoom
>
19
)
{
return
QString
(
""
);
}
else
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Base/service/%1/%2/%3.png"
).
arg
(
zoom
).
arg
(
x
).
arg
(
y
);
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Base/service/%1/%2/%3.png"
).
arg
(
zoom
).
arg
(
x
).
arg
(
y
);
}
}
else
{
else
{
...
@@ -453,7 +457,10 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
...
@@ -453,7 +457,10 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
if
(
zoom
>
19
)
{
return
QString
(
""
);
}
else
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Satellite/service/%1/%2/%3.jpeg"
).
arg
(
zoom
).
arg
(
x
).
arg
(
y
);
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Satellite/service/%1/%2/%3.jpeg"
).
arg
(
zoom
).
arg
(
x
).
arg
(
y
);
}
}
else
{
else
{
...
...
src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
View file @
cf6089d0
...
@@ -75,7 +75,12 @@ QGeoTileFetcherQGC::getTileImage(const QGeoTileSpec &spec)
...
@@ -75,7 +75,12 @@ QGeoTileFetcherQGC::getTileImage(const QGeoTileSpec &spec)
{
{
//-- Build URL
//-- Build URL
QNetworkRequest
request
=
getQGCMapEngine
()
->
urlFactory
()
->
getTileURL
((
UrlFactory
::
MapType
)
spec
.
mapId
(),
spec
.
x
(),
spec
.
y
(),
spec
.
zoom
(),
_networkManager
);
QNetworkRequest
request
=
getQGCMapEngine
()
->
urlFactory
()
->
getTileURL
((
UrlFactory
::
MapType
)
spec
.
mapId
(),
spec
.
x
(),
spec
.
y
(),
spec
.
zoom
(),
_networkManager
);
if
(
!
request
.
url
().
isEmpty
()
)
{
return
new
QGeoTiledMapReplyQGC
(
_networkManager
,
request
,
spec
);
return
new
QGeoTiledMapReplyQGC
(
_networkManager
,
request
,
spec
);
}
else
{
return
NULL
;
}
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
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