FlightDisplayViewMap.qml 21.2 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9 10


11 12 13 14 15
import QtQuick                      2.11
import QtQuick.Controls             2.4
import QtLocation                   5.3
import QtPositioning                5.3
import QtQuick.Dialogs              1.2
16 17

import QGroundControl               1.0
18 19 20
import QGroundControl.Airspace      1.0
import QGroundControl.Controllers   1.0
import QGroundControl.Controls      1.0
21 22 23
import QGroundControl.FlightDisplay 1.0
import QGroundControl.FlightMap     1.0
import QGroundControl.Palette       1.0
24
import QGroundControl.ScreenTools   1.0
25 26 27
import QGroundControl.Vehicle       1.0

FlightMap {
28 29 30 31
    id:                         flightMap
    mapName:                    _mapName
    allowGCSLocationCenter:     !userPanned
    allowVehicleLocationCenter: !_keepVehicleCentered
32
    planView:                   false
33 34
    zoomLevel:                  QGroundControl.flightMapZoom
    center:                     QGroundControl.flightMapPosition
35

36 37
    property alias  scaleState: mapScale.state

38
    // The following properties must be set by the consumer
39
    property var    guidedActionsController
Don Gagne's avatar
Don Gagne committed
40
    property var    flightWidgets
41
    property var    rightPanelWidth
42
    property var    multiVehicleView                    ///< true: multi-vehicle view, false: single vehicle view
43
    property var    missionController:          null
Don Gagne's avatar
Don Gagne committed
44

45 46
    property rect   centerViewport:             Qt.rect(0, 0, width, height)

Gus Grubba's avatar
Gus Grubba committed
47 48
    property var    _geoFenceController:        missionController.geoFenceController
    property var    _rallyPointController:      missionController.rallyPointController
Gus Grubba's avatar
Gus Grubba committed
49
    property var    _activeVehicleCoordinate:   activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate()
50
    property real   _toolButtonTopMargin:       parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2)
Gus Grubba's avatar
Gus Grubba committed
51
    property bool   _airspaceEnabled:           QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
52 53
    property var    _flyViewSettings:           QGroundControl.settingsManager.flyViewSettings
    property bool   _keepMapCenteredOnVehicle:  _flyViewSettings.keepMapCenteredOnVehicle.rawValue
54

55
    property bool   _disableVehicleTracking:    false
56
    property bool   _keepVehicleCentered:       mainIsMap ? false : true
57
    property bool   _pipping:                   false
58

59
    function updateAirspace(reset) {
60
        if(_airspaceEnabled) {
61 62 63
            var coordinateNW = flightMap.toCoordinate(Qt.point(0,0), false /* clipToViewPort */)
            var coordinateSE = flightMap.toCoordinate(Qt.point(width,height), false /* clipToViewPort */)
            if(coordinateNW.isValid && coordinateSE.isValid) {
64
                QGroundControl.airspaceManager.setROI(coordinateNW, coordinateSE, false /*planView*/, reset)
65
            }
66
        }
67 68
    }

69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
    function pipIn() {
        if(QGroundControl.flightMapZoom > 3) {
            _pipping = true;
            zoomLevel = QGroundControl.flightMapZoom - 3
            _pipping = false;
        }
    }

    function pipOut() {
        _pipping = true;
        zoomLevel = QGroundControl.flightMapZoom
        _pipping = false;
    }

    function adjustMapSize() {
        if(mainIsMap)
            pipOut()
        else
            pipIn()
    }

90 91
    // Track last known map position and zoom from Fly view in settings

92 93 94 95 96 97 98
    onVisibleChanged: {
        if(visible) {
            adjustMapSize()
            center    = QGroundControl.flightMapPosition
        }
    }

99
    onZoomLevelChanged: {
100 101 102 103
        if(!_pipping) {
            QGroundControl.flightMapZoom = zoomLevel
            updateAirspace(false)
        }
104 105
    }
    onCenterChanged: {
106
        QGroundControl.flightMapPosition = center
107
        updateAirspace(false)
108
    }
109

110
    // When the user pans the map we stop responding to vehicle coordinate updates until the panRecenterTimer fires
111
    onUserPannedChanged: {
DonLakeFlyer's avatar
DonLakeFlyer committed
112 113 114 115 116
        if (userPanned) {
            userPanned = false
            _disableVehicleTracking = true
            panRecenterTimer.restart()
        }
117 118
    }

Gus Grubba's avatar
Gus Grubba committed
119
    on_AirspaceEnabledChanged: {
120
        updateAirspace(true)
Gus Grubba's avatar
Gus Grubba committed
121 122
    }

123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
    function pointInRect(point, rect) {
        return point.x > rect.x &&
                point.x < rect.x + rect.width &&
                point.y > rect.y &&
                point.y < rect.y + rect.height;
    }

    property real _animatedLatitudeStart
    property real _animatedLatitudeStop
    property real _animatedLongitudeStart
    property real _animatedLongitudeStop
    property real animatedLatitude
    property real animatedLongitude

    onAnimatedLatitudeChanged: flightMap.center = QtPositioning.coordinate(animatedLatitude, animatedLongitude)
    onAnimatedLongitudeChanged: flightMap.center = QtPositioning.coordinate(animatedLatitude, animatedLongitude)

    NumberAnimation on animatedLatitude { id: animateLat; from: _animatedLatitudeStart; to: _animatedLatitudeStop; duration: 1000 }
    NumberAnimation on animatedLongitude { id: animateLong; from: _animatedLongitudeStart; to: _animatedLongitudeStop; duration: 1000 }

    function animatedMapRecenter(fromCoord, toCoord) {
        _animatedLatitudeStart = fromCoord.latitude
        _animatedLongitudeStart = fromCoord.longitude
        _animatedLatitudeStop = toCoord.latitude
        _animatedLongitudeStop = toCoord.longitude
        animateLat.start()
        animateLong.start()
    }

    function recenterNeeded() {
153
        var vehiclePoint = flightMap.fromCoordinate(_activeVehicleCoordinate, false /* clipToViewport */)
154 155
        var toolStripRightEdge = mapFromItem(toolStrip, toolStrip.x, 0).x + toolStrip.width
        var instrumentsWidth = 0
156
        if (QGroundControl.corePlugin.options.instrumentWidget && QGroundControl.corePlugin.options.instrumentWidget.widgetPosition === CustomInstrumentWidget.POS_TOP_RIGHT) {
157 158 159 160
            // Assume standard instruments
            instrumentsWidth = flightDisplayViewWidgets.getPreferredInstrumentWidth()
        }
        var centerViewport = Qt.rect(toolStripRightEdge, 0, width - toolStripRightEdge - instrumentsWidth, height)
161
        return !pointInRect(vehiclePoint, centerViewport)
162 163 164
    }

    function updateMapToVehiclePosition() {
165
        // We let FlightMap handle first vehicle position
166
        if (!_keepMapCenteredOnVehicle && firstVehiclePositionReceived && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) {
167
            if (_keepVehicleCentered) {
168
                flightMap.center = _activeVehicleCoordinate
169
            } else {
DonLakeFlyer's avatar
DonLakeFlyer committed
170
                if (firstVehiclePositionReceived && recenterNeeded()) {
171
                    animatedMapRecenter(flightMap.center, _activeVehicleCoordinate)
172 173
                }
            }
174 175 176
        }
    }

177 178 179 180 181 182
    on_ActiveVehicleCoordinateChanged: {
        if (_keepMapCenteredOnVehicle && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) {
            flightMap.center = _activeVehicleCoordinate
        }
    }

183
    Timer {
184 185 186
        id:         panRecenterTimer
        interval:   10000
        running:    false
187
        onTriggered: {
188
            _disableVehicleTracking = false
189
            updateMapToVehiclePosition()
190 191 192
        }
    }

193 194 195 196 197 198 199
    Timer {
        interval:       500
        running:        true
        repeat:         true
        onTriggered:    updateMapToVehiclePosition()
    }

200
    QGCMapPalette { id: mapPal; lightColors: isSatelliteMap }
Don Gagne's avatar
Don Gagne committed
201

202
    Connections {
203 204
        target:                 missionController
        ignoreUnknownSignals:   true
205
        onNewItemsFromVehicle: {
Gus Grubba's avatar
Gus Grubba committed
206
            var visualItems = missionController.visualItems
207
            if (visualItems && visualItems.count !== 1) {
208
                mapFitFunctions.fitMapViewportToMissionItems()
209
                firstVehiclePositionReceived = true
210 211
            }
        }
212 213
    }

Don Gagne's avatar
Don Gagne committed
214
    MapFitFunctions {
215
        id:                         mapFitFunctions // The name for this id cannot be changed without breaking references outside of this code. Beware!
216
        map:                        mainWindow.flightDisplayMap
Don Gagne's avatar
Don Gagne committed
217
        usePlannedHomePosition:     false
Gus Grubba's avatar
Gus Grubba committed
218 219
        planMasterController:       missionController
        property real leftToolWidth: toolStrip.x + toolStrip.width
Don Gagne's avatar
Don Gagne committed
220
    }
221

222 223 224 225 226 227
    // Add trajectory lines to the map
    MapPolyline {
        id:         trajectoryPolyline
        line.width: 3
        line.color: "red"
        z:          QGroundControl.zOrderTrajectoryLines
228
        visible:    mainIsMap
229 230 231 232 233 234 235 236 237 238 239

        Connections {
            target:                 QGroundControl.multiVehicleManager
            onActiveVehicleChanged: trajectoryPolyline.path = activeVehicle ? activeVehicle.trajectoryPoints.list() : []
        }

        Connections {
            target:                 activeVehicle ? activeVehicle.trajectoryPoints : null
            onPointAdded:           trajectoryPolyline.addCoordinate(coordinate)
            onUpdateLastPoint:      trajectoryPolyline.replaceCoordinate(trajectoryPolyline.pathLength() - 1, coordinate)
            onPointsCleared:        trajectoryPolyline.path = []
Don Gagne's avatar
Don Gagne committed
240
        }
241 242 243 244
    }

    // Add the vehicles to the map
    MapItemView {
245
        model: QGroundControl.multiVehicleManager.vehicles
DonLakeFlyer's avatar
DonLakeFlyer committed
246
        delegate: VehicleMapItem {
Don Gagne's avatar
Don Gagne committed
247 248
            vehicle:        object
            coordinate:     object.coordinate
249
            map:            flightMap
250
            size:           mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
DonLakeFlyer's avatar
DonLakeFlyer committed
251
            z:              QGroundControl.zOrderVehicles
Don Gagne's avatar
Don Gagne committed
252
        }
253 254
    }

255 256
    // Add ADSB vehicles to the map
    MapItemView {
257
        model: QGroundControl.adsbVehicleManager.adsbVehicles
258 259 260
        delegate: VehicleMapItem {
            coordinate:     object.coordinate
            altitude:       object.altitude
261
            callsign:       object.callsign
262
            heading:        object.heading
Gus Grubba's avatar
Gus Grubba committed
263
            alert:          object.alert
264 265 266 267 268
            map:            flightMap
            z:              QGroundControl.zOrderVehicles
        }
    }

269 270 271 272 273 274
    // Add the items associated with each vehicles flight plan to the map
    Repeater {
        model: QGroundControl.multiVehicleManager.vehicles

        PlanMapItems {
            map:                flightMap
275
            largeMapView:       mainIsMap
276
            masterController:   masterController
277
            vehicle:            _vehicle
278 279 280 281 282 283 284 285

            property var _vehicle: object

            PlanMasterController {
                id: masterController
                Component.onCompleted: startStaticActiveVehicle(object)
            }
        }
286 287
    }

288 289 290 291 292 293 294 295 296 297 298
    MapItemView {
        model: mainIsMap ? _missionController.directionArrows : undefined

        delegate: MapLineArrow {
            fromCoord:      object ? object.coordinate1 : undefined
            toCoord:        object ? object.coordinate2 : undefined
            arrowPosition:  2
            z:              QGroundControl.zOrderWaypointLines
        }
    }

299 300 301
    // Allow custom builds to add map items
    CustomMapItems {
        map:            flightMap
302
        largeMapView:   mainIsMap
303 304
    }

305 306
    GeoFenceMapVisuals {
        map:                    flightMap
307
        myGeoFenceController:   _geoFenceController
308
        interactive:            false
309
        planView:               false
Gus Grubba's avatar
Gus Grubba committed
310
        homePosition:           activeVehicle && activeVehicle.homePosition.isValid ? activeVehicle.homePosition :  QtPositioning.coordinate()
311 312
    }

313 314
    // Rally points on map
    MapItemView {
315
        model: _rallyPointController.points
316 317 318

        delegate: MapQuickItem {
            id:             itemIndicator
319 320
            anchorPoint.x:  sourceItem.anchorPointX
            anchorPoint.y:  sourceItem.anchorPointY
321 322 323 324 325 326 327 328 329 330
            coordinate:     object.coordinate
            z:              QGroundControl.zOrderMapItems

            sourceItem: MissionItemIndexLabel {
                id:         itemIndexLabel
                label:      qsTr("R", "rally point map item label")
            }
        }
    }

DonLakeFlyer's avatar
DonLakeFlyer committed
331 332
    // Camera trigger points
    MapItemView {
Gus Grubba's avatar
Gus Grubba committed
333
        model: activeVehicle ? activeVehicle.cameraTriggerPoints : 0
DonLakeFlyer's avatar
DonLakeFlyer committed
334 335 336 337 338 339 340

        delegate: CameraTriggerIndicator {
            coordinate:     object.coordinate
            z:              QGroundControl.zOrderTopMost
        }
    }

341
    // GoTo Location visuals
Don Gagne's avatar
Don Gagne committed
342
    MapQuickItem {
343 344
        id:             gotoLocationItem
        visible:        false
Don Gagne's avatar
Don Gagne committed
345
        z:              QGroundControl.zOrderMapItems
346 347
        anchorPoint.x:  sourceItem.anchorPointX
        anchorPoint.y:  sourceItem.anchorPointY
Don Gagne's avatar
Don Gagne committed
348
        sourceItem: MissionItemIndexLabel {
DonLakeFlyer's avatar
DonLakeFlyer committed
349 350
            checked:    true
            index:      -1
351
            label:      qsTr("Go here", "Go to location waypoint")
Don Gagne's avatar
Don Gagne committed
352
        }
353

Gus Grubba's avatar
Gus Grubba committed
354
        property bool inGotoFlightMode: activeVehicle ? activeVehicle.flightMode === activeVehicle.gotoFlightMode : false
355 356

        onInGotoFlightModeChanged: {
357
            if (!inGotoFlightMode && gotoLocationItem.visible) {
358
                // Hide goto indicator when vehicle falls out of guided mode
359
                gotoLocationItem.visible = false
360 361 362
            }
        }

Gus Grubba's avatar
Gus Grubba committed
363 364 365 366
        Connections {
            target: mainWindow
            onActiveVehicleChanged: {
                if (!activeVehicle) {
367
                    gotoLocationItem.visible = false
Gus Grubba's avatar
Gus Grubba committed
368
                }
369 370 371
            }
        }

372 373 374 375
        function show(coord) {
            gotoLocationItem.coordinate = coord
            gotoLocationItem.visible = true
        }
376

377 378 379 380
        function hide() {
            gotoLocationItem.visible = false
        }

381 382 383 384 385 386 387 388
        function actionConfirmed() {
            // We leave the indicator visible. The handling for onInGuidedModeChanged will hide it.
        }

        function actionCancelled() {
            hide()
        }
    }
389

390
    // Orbit editing visuals
391
    QGCMapCircleVisuals {
392 393 394 395
        id:             orbitMapCircle
        mapControl:     parent
        mapCircle:      _mapCircle
        visible:        false
396

397 398
        property alias center:              _mapCircle.center
        property alias clockwiseRotation:   _mapCircle.clockwiseRotation
399 400
        readonly property real defaultRadius: 30

Gus Grubba's avatar
Gus Grubba committed
401 402 403 404
        Connections {
            target: mainWindow
            onActiveVehicleChanged: {
                if (!activeVehicle) {
405
                    orbitMapCircle.visible = false
Gus Grubba's avatar
Gus Grubba committed
406
                }
407 408 409
            }
        }

410
        function show(coord) {
DonLakeFlyer's avatar
DonLakeFlyer committed
411
            _mapCircle.radius.rawValue = defaultRadius
412 413 414 415 416 417 418 419
            orbitMapCircle.center = coord
            orbitMapCircle.visible = true
        }

        function hide() {
            orbitMapCircle.visible = false
        }

420 421 422 423 424 425 426 427 428
        function actionConfirmed() {
            // Live orbit status is handled by telemetry so we hide here and telemetry will show again.
            hide()
        }

        function actionCancelled() {
            hide()
        }

DonLakeFlyer's avatar
DonLakeFlyer committed
429 430 431 432
        function radius() {
            return _mapCircle.radius.rawValue
        }

433 434 435 436 437
        Component.onCompleted: guidedActionsController.orbitMapCircle = orbitMapCircle

        QGCMapCircle {
            id:                 _mapCircle
            interactive:        true
DonLakeFlyer's avatar
DonLakeFlyer committed
438
            radius.rawValue:    30
439 440
            showRotation:       true
            clockwiseRotation:  true
441 442 443
        }
    }

Gus Grubba's avatar
Gus Grubba committed
444 445 446
    // ROI Location visuals
    MapQuickItem {
        id:             roiLocationItem
447
        visible:        activeVehicle && activeVehicle.isROIEnabled
Gus Grubba's avatar
Gus Grubba committed
448 449 450 451 452 453 454 455 456
        z:              QGroundControl.zOrderMapItems
        anchorPoint.x:  sourceItem.anchorPointX
        anchorPoint.y:  sourceItem.anchorPointY
        sourceItem: MissionItemIndexLabel {
            checked:    true
            index:      -1
            label:      qsTr("ROI here", "Make this a Region Of Interest")
        }

457
        //-- Visibilty controlled by actual state
Gus Grubba's avatar
Gus Grubba committed
458 459 460 461 462 463 464 465 466 467 468 469 470 471
        function show(coord) {
            roiLocationItem.coordinate = coord
        }

        function hide() {
        }

        function actionConfirmed() {
        }

        function actionCancelled() {
        }
    }

472
    // Orbit telemetry visuals
473
    QGCMapCircleVisuals {
474
        id:             orbitTelemetryCircle
475
        mapControl:     parent
Gus Grubba's avatar
Gus Grubba committed
476 477
        mapCircle:      activeVehicle ? activeVehicle.orbitMapCircle : null
        visible:        activeVehicle ? activeVehicle.orbitActive : false
478 479
    }

480 481 482 483
    MapQuickItem {
        id:             orbitCenterIndicator
        anchorPoint.x:  sourceItem.anchorPointX
        anchorPoint.y:  sourceItem.anchorPointY
Gus Grubba's avatar
Gus Grubba committed
484
        coordinate:     activeVehicle ? activeVehicle.orbitMapCircle.center : QtPositioning.coordinate()
485 486 487 488 489 490 491 492 493
        visible:        orbitTelemetryCircle.visible

        sourceItem: MissionItemIndexLabel {
            checked:    true
            index:      -1
            label:      qsTr("Orbit", "Orbit waypoint")
        }
    }

Don Gagne's avatar
Don Gagne committed
494
    // Handle guided mode clicks
495 496
    MouseArea {
        anchors.fill: parent
Don Gagne's avatar
Don Gagne committed
497

498
        QGCMenu {
DonLakeFlyer's avatar
DonLakeFlyer committed
499
            id: clickMenu
500
            property var coord
501
            QGCMenuItem {
DonLakeFlyer's avatar
DonLakeFlyer committed
502 503 504 505
                text:           qsTr("Go to location")
                visible:        guidedActionsController.showGotoLocation

                onTriggered: {
506 507
                    gotoLocationItem.show(clickMenu.coord)
                    orbitMapCircle.hide()
508
                    guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickMenu.coord, gotoLocationItem)
DonLakeFlyer's avatar
DonLakeFlyer committed
509 510
                }
            }
511
            QGCMenuItem {
DonLakeFlyer's avatar
DonLakeFlyer committed
512 513
                text:           qsTr("Orbit at location")
                visible:        guidedActionsController.showOrbit
514

DonLakeFlyer's avatar
DonLakeFlyer committed
515
                onTriggered: {
516 517
                    orbitMapCircle.show(clickMenu.coord)
                    gotoLocationItem.hide()
518
                    guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickMenu.coord, orbitMapCircle)
DonLakeFlyer's avatar
DonLakeFlyer committed
519 520
                }
            }
Gus Grubba's avatar
Gus Grubba committed
521 522 523 524 525 526 527 528 529
            QGCMenuItem {
                text:           qsTr("ROI at location")
                visible:        guidedActionsController.showROI

                onTriggered: {
                    roiLocationItem.show(clickMenu.coord)
                    guidedActionsController.confirmAction(guidedActionsController.actionROI, clickMenu.coord, orbitMapCircle)
                }
            }
DonLakeFlyer's avatar
DonLakeFlyer committed
530 531
        }

Don Gagne's avatar
Don Gagne committed
532
        onClicked: {
DonLakeFlyer's avatar
DonLakeFlyer committed
533 534
            if (guidedActionsController.guidedUIVisible || (!guidedActionsController.showGotoLocation && !guidedActionsController.showOrbit)) {
                return
Gus Grubba's avatar
Gus Grubba committed
535
            }
536 537 538
            orbitMapCircle.hide()
            gotoLocationItem.hide()
            var clickCoord = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
DonLakeFlyer's avatar
DonLakeFlyer committed
539
            if (guidedActionsController.showGotoLocation && guidedActionsController.showOrbit) {
540
                clickMenu.coord = clickCoord
DonLakeFlyer's avatar
DonLakeFlyer committed
541 542
                clickMenu.popup()
            } else if (guidedActionsController.showGotoLocation) {
DonLakeFlyer's avatar
DonLakeFlyer committed
543
                gotoLocationItem.show(clickCoord)
544
                guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickCoord)
DonLakeFlyer's avatar
DonLakeFlyer committed
545
            } else if (guidedActionsController.showOrbit) {
546 547
                orbitMapCircle.show(clickCoord)
                guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickCoord)
Don Gagne's avatar
Don Gagne committed
548 549
            }
        }
550
    }
551 552

    MapScale {
553
        id:                     mapScale
554
        anchors.right:          parent.right
555 556
        anchors.margins:        _toolsMargin
        anchors.topMargin:      _toolsMargin + state === "bottomMode" ? 0 : ScreenTools.toolbarHeight
557
        mapControl:             flightMap
558
        buttonsOnLeft:          false
559
        visible:                !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.enableMapScale && mainIsMap
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
        state:                  "bottomMode"
        states: [
            State {
                name:   "topMode"
                AnchorChanges {
                    target:                 mapScale
                    anchors.top:            parent.top
                    anchors.bottom:         undefined
                }
            },
            State {
                name:   "bottomMode"
                AnchorChanges {
                    target:                 mapScale
                    anchors.top:            undefined
                    anchors.bottom:         parent.bottom
                }
            }
        ]
579
    }
580

581
    // Airspace overlap support
582
    MapItemView {
583
        model:              _airspaceEnabled && QGroundControl.settingsManager.airMapSettings.enableAirspace && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.circles : []
584 585 586
        delegate: MapCircle {
            center:         object.center
            radius:         object.radius
587
            color:          object.color
Gus Grubba's avatar
Gus Grubba committed
588 589
            border.color:   object.lineColor
            border.width:   object.lineWidth
590 591 592 593
        }
    }

    MapItemView {
594
        model:              _airspaceEnabled && QGroundControl.settingsManager.airMapSettings.enableAirspace && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.polygons : []
595 596
        delegate: MapPolygon {
            path:           object.polygon
597
            color:          object.color
Gus Grubba's avatar
Gus Grubba committed
598 599
            border.color:   object.lineColor
            border.width:   object.lineWidth
600 601
        }
    }
602

603
}