|
|
|
@ -67,7 +67,6 @@ QGCView {
@@ -67,7 +67,6 @@ QGCView {
|
|
|
|
|
|
|
|
|
|
property bool _syncInProgress: _activeVehicle ? _activeVehicle.missionManager.inProgress : false |
|
|
|
|
|
|
|
|
|
Component.onCompleted: updateMapToVehiclePosition() |
|
|
|
|
onActiveVehiclePositionChanged: updateMapToVehiclePosition() |
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
@ -118,8 +117,11 @@ QGCView {
@@ -118,8 +117,11 @@ QGCView {
|
|
|
|
|
return lon + 180.0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Fix the map viewport to the current mission items. We don't fit the home position in this process. |
|
|
|
|
/// Fix the map viewport to the current mission items. |
|
|
|
|
function fitViewportToMissionItems() { |
|
|
|
|
if (_missionItems.count == 1) { |
|
|
|
|
editorMap.center = _missionItems.get(0).coordinate |
|
|
|
|
} else { |
|
|
|
|
var missionItem = _missionItems.get(0) |
|
|
|
|
var north = normalizeLat(missionItem.coordinate.latitude) |
|
|
|
|
var south = north |
|
|
|
@ -139,9 +141,9 @@ QGCView {
@@ -139,9 +141,9 @@ QGCView {
|
|
|
|
|
west = Math.min(west, lon) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
editorMap.visibleRegion = QtPositioning.rectangle(QtPositioning.coordinate(north - 90.0, west - 180.0), QtPositioning.coordinate(south - 90.0, east - 180.0)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MissionController { |
|
|
|
|
id: controller |
|
|
|
@ -286,6 +288,9 @@ QGCView {
@@ -286,6 +288,9 @@ QGCView {
|
|
|
|
|
|
|
|
|
|
readonly property real animationDuration: 500 |
|
|
|
|
|
|
|
|
|
// Initial map position duplicates Fly view position |
|
|
|
|
Component.onCompleted: editorMap.center = QGroundControl.flightMapPosition |
|
|
|
|
|
|
|
|
|
Behavior on zoomLevel { |
|
|
|
|
NumberAnimation { |
|
|
|
|
duration: editorMap.animationDuration |
|
|
|
@ -541,6 +546,15 @@ QGCView {
@@ -541,6 +546,15 @@ QGCView {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Mission" |
|
|
|
|
|
|
|
|
|
onClicked: { |
|
|
|
|
centerMapButton.hideDropDown() |
|
|
|
|
fitViewportToMissionItems() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Vehicle" |
|
|
|
|
enabled: activeVehicle && activeVehicle.latitude != 0 && activeVehicle.longitude != 0 |
|
|
|
|
|
|
|
|
|