Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
85b939db
Commit
85b939db
authored
Jun 06, 2018
by
DonLakeFlyer
Browse files
Support for center map to specified location
parent
a640bcec
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/FlightMap/FlightMap.qml
View file @
85b939db
...
...
@@ -11,6 +11,7 @@ import QtQuick 2.3
import
QtQuick
.
Controls
1.2
import
QtLocation
5.3
import
QtPositioning
5.3
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
import
QGroundControl
.
FactSystem
1.0
...
...
@@ -40,6 +41,7 @@ Map {
property
bool
firstGCSPositionReceived
:
false
///< true: first gcs position update was responded to
property
bool
firstVehiclePositionReceived
:
false
///< true: first vehicle position update was responded to
property
bool
planView
:
false
///< true: map being using for Plan view, items should be draggable
property
var
qgcView
readonly
property
real
maxZoomLevel
:
20
...
...
@@ -62,6 +64,20 @@ Map {
}
}
function
centerToSpecifiedLocation
()
{
qgcView
.
showDialog
(
specifyMapPositionDialog
,
qsTr
(
"
Specify Position
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
Component
{
id
:
specifyMapPositionDialog
EditPositionDialog
{
coordinate
:
center
onCoordinateChanged
:
center
=
coordinate
}
}
ExclusiveGroup
{
id
:
mapTypeGroup
}
// Update ground station position
...
...
src/FlightMap/Widgets/CenterMapDropButton.qml
View file @
85b939db
...
...
@@ -209,6 +209,17 @@ DropButton {
}
}
QGCButton
{
text
:
qsTr
(
"
Specified Location
"
)
Layout.fillWidth
:
true
onClicked
:
{
dropButton
.
hideDropDown
()
map
.
centerToSpecifiedLocation
()
}
}
QGCButton
{
text
:
qsTr
(
"
Vehicle
"
)
Layout.fillWidth
:
true
...
...
src/FlightMap/Widgets/CenterMapDropPanel.qml
View file @
85b939db
...
...
@@ -62,6 +62,17 @@ ColumnLayout {
}
}
QGCButton
{
text
:
qsTr
(
"
Vehicle
"
)
Layout.fillWidth
:
true
enabled
:
_activeVehicle
&&
_activeVehicle
.
coordinate
.
isValid
onClicked
:
{
dropPanel
.
hide
()
map
.
center
=
activeVehicle
.
coordinate
}
}
QGCButton
{
text
:
qsTr
(
"
Current Location
"
)
Layout.fillWidth
:
true
...
...
@@ -74,13 +85,12 @@ ColumnLayout {
}
QGCButton
{
text
:
qsTr
(
"
Vehicle
"
)
text
:
qsTr
(
"
Specified Location
"
)
Layout.fillWidth
:
true
enabled
:
_activeVehicle
&&
_activeVehicle
.
coordinate
.
isValid
onClicked
:
{
dropPanel
.
hide
()
map
.
center
=
activeVehicle
.
coordinate
map
.
center
ToSpecifiedLocation
()
}
}
}
// Column
src/PlanView/PlanView.qml
View file @
85b939db
...
...
@@ -411,6 +411,7 @@ QGCView {
allowGCSLocationCenter
:
true
allowVehicleLocationCenter
:
true
planView
:
true
qgcView
:
_qgcView
// This is the center rectangle of the map which is not obscured by tools
property
rect
centerViewport
:
Qt
.
rect
(
_leftToolWidth
,
_toolbarHeight
,
editorMap
.
width
-
_leftToolWidth
-
_rightPanelWidth
,
editorMap
.
height
-
_statusHeight
-
_toolbarHeight
)
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
85b939db
...
...
@@ -364,6 +364,7 @@ QGCView {
allowVehicleLocationCenter
:
false
gesture.flickDeceleration
:
3000
mapName
:
"
OfflineMap
"
qgcView
:
offlineMapView
property
bool
isSatelliteMap
:
activeMapType
.
name
.
indexOf
(
"
Satellite
"
)
>
-
1
||
activeMapType
.
name
.
indexOf
(
"
Hybrid
"
)
>
-
1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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