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
29b0c65a
Commit
29b0c65a
authored
Apr 19, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a MapRectangle item to show the tile set region.
parent
781c7e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+21
-10
No files found.
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
29b0c65a
...
@@ -26,8 +26,8 @@ import QtQuick.Controls 1.2
...
@@ -26,8 +26,8 @@ import QtQuick.Controls 1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.1
import
QtQuick
.
Dialogs
1.1
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Layouts
1.2
import
QtLocation
5.
3
import
QtLocation
5.
5
import
QtPositioning
5.
3
import
QtPositioning
5.
5
import
QGroundControl
1.0
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
...
@@ -174,14 +174,15 @@ Rectangle {
...
@@ -174,14 +174,15 @@ Rectangle {
_map
.
visible
=
true
_map
.
visible
=
true
mapType
=
_offlineMapRoot
.
_currentSelection
.
mapTypeStr
mapType
=
_offlineMapRoot
.
_currentSelection
.
mapTypeStr
_map
.
center
=
midPoint
(
_offlineMapRoot
.
_currentSelection
.
topleftLat
,
_offlineMapRoot
.
_currentSelection
.
bottomRightLat
,
_offlineMapRoot
.
_currentSelection
.
topleftLon
,
_offlineMapRoot
.
_currentSelection
.
bottomRightLon
)
_map
.
center
=
midPoint
(
_offlineMapRoot
.
_currentSelection
.
topleftLat
,
_offlineMapRoot
.
_currentSelection
.
bottomRightLat
,
_offlineMapRoot
.
_currentSelection
.
topleftLon
,
_offlineMapRoot
.
_currentSelection
.
bottomRightLon
)
_map
.
zoomLevel
=
_offlineMapRoot
.
_currentSelection
.
minZoom
//-- Delineate Set Region
var
p
=
_map
.
fromCoordinate
(
QtPositioning
.
coordinate
(
_offlineMapRoot
.
_currentSelection
.
topleftLat
,
_offlineMapRoot
.
_currentSelection
.
topleftLon
),
false
)
var
x0
=
_offlineMapRoot
.
_currentSelection
.
topleftLon
console
.
log
(
_map
.
zoomLevel
+
"
"
+
p
)
var
x1
=
_offlineMapRoot
.
_currentSelection
.
bottomRightLon
while
((
isNaN
(
p
.
x
)
||
isNaN
(
p
.
y
)
||
(
p
.
x
>
25
&&
p
.
y
>
25
))
&&
_map
.
zoomLevel
<
_offlineMapRoot
.
_currentSelection
.
maxZoom
)
{
var
y0
=
_offlineMapRoot
.
_currentSelection
.
topleftLat
_map
.
zoomLevel
=
_map
.
zoomLevel
+
1
var
y1
=
_offlineMapRoot
.
_currentSelection
.
bottomRightLat
p
=
_map
.
fromCoordinate
(
QtPositioning
.
coordinate
(
_offlineMapRoot
.
_currentSelection
.
topleftLat
,
_offlineMapRoot
.
_currentSelection
.
topleftLon
),
false
)
mapBoundary
.
topLeft
=
QtPositioning
.
coordinate
(
y0
,
x0
)
console
.
log
(
_map
.
zoomLevel
+
"
"
+
p
)
mapBoundary
.
bottomRight
=
QtPositioning
.
coordinate
(
y1
,
x1
)
}
mapBoundary
.
visible
=
true
_map
.
fitViewportToMapItems
()
}
}
_tileSetList
.
visible
=
false
_tileSetList
.
visible
=
false
_mapView
.
visible
=
false
_mapView
.
visible
=
false
...
@@ -199,6 +200,7 @@ Rectangle {
...
@@ -199,6 +200,7 @@ Rectangle {
}
}
function
leaveInfoView
()
{
function
leaveInfoView
()
{
mapBoundary
.
visible
=
false
_map
.
center
=
savedCenter
_map
.
center
=
savedCenter
_map
.
zoomLevel
=
savedZoom
_map
.
zoomLevel
=
savedZoom
mapType
=
savedMapType
mapType
=
savedMapType
...
@@ -273,6 +275,15 @@ Rectangle {
...
@@ -273,6 +275,15 @@ Rectangle {
anchors.fill
:
parent
anchors.fill
:
parent
}
}
MapRectangle
{
id
:
mapBoundary
border.width
:
2
border.color
:
"
red
"
color
:
Qt
.
rgba
(
1
,
0
,
0
,
0.05
)
smooth
:
true
antialiasing
:
true
}
Component.onCompleted
:
{
Component.onCompleted
:
{
center
=
QGroundControl
.
flightMapPosition
center
=
QGroundControl
.
flightMapPosition
zoomLevel
=
QGroundControl
.
flightMapZoom
zoomLevel
=
QGroundControl
.
flightMapZoom
...
...
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