From 33ee98333d73905a221fee4703b38efd248eb8fa Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 17 Nov 2016 09:32:07 -0800 Subject: [PATCH] Correct handling of fence visibility --- src/FlightDisplay/FlightDisplayViewMap.qml | 8 +++++--- src/MissionEditor/MissionEditor.qml | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index decd6d79c..2d631ecec 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -110,7 +110,8 @@ FlightMap { MapPolygon { border.color: "#80FF0000" border.width: 3 - path: geoFenceController.polygonSupported ? geoFenceController.polygon.path : undefined + path: geoFenceController.polygon.path + visible: geoFenceController.fenceEnabled && geoFenceController.polygonSupported } // GeoFence circle @@ -118,15 +119,16 @@ FlightMap { border.color: "#80FF0000" border.width: 3 center: missionController.plannedHomePosition - radius: geoFenceController.circleSupported ? geoFenceController.circleRadius : 0 + radius: (geoFenceController.fenceEnabled && geoFenceController.circleSupported) ? geoFenceController.circleRadius : 0 z: QGroundControl.zOrderMapItems + visible: geoFenceController.fenceEnabled && geoFenceController.circleSupported } // GeoFence breach return point MapQuickItem { anchorPoint: Qt.point(sourceItem.width / 2, sourceItem.height / 2) coordinate: geoFenceController.breachReturnPoint - visible: geoFenceController.breachReturnSupported + visible: geoFenceController.fenceEnabled && geoFenceController.breachReturnSupported sourceItem: MissionItemIndexLabel { label: "F" } z: QGroundControl.zOrderMapItems } diff --git a/src/MissionEditor/MissionEditor.qml b/src/MissionEditor/MissionEditor.qml index 550cf2461..007234bec 100644 --- a/src/MissionEditor/MissionEditor.qml +++ b/src/MissionEditor/MissionEditor.qml @@ -786,8 +786,9 @@ QGCView { MapPolygon { border.color: "#80FF0000" border.width: 3 - path: geoFenceController.polygonSupported ? geoFenceController.polygon.path : undefined + path: geoFenceController.polygon.path z: QGroundControl.zOrderMapItems + visible: geoFenceController.polygonSupported } // GeoFence circle @@ -797,6 +798,7 @@ QGCView { center: missionController.plannedHomePosition radius: geoFenceController.circleSupported ? geoFenceController.circleRadius : 0 z: QGroundControl.zOrderMapItems + visible: geoFenceController.circleSupported } // GeoFence breach return point -- 2.22.0