FlightDisplayViewMap.qml 21.8 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * 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.3
import QtQuick.Controls 1.2
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 32
    id:                         flightMap
    anchors.fill:               parent
    mapName:                    _mapName
    allowGCSLocationCenter:     !userPanned
    allowVehicleLocationCenter: !_keepVehicleCentered
33
    planView:                   false
34

35

36 37
    property alias  scaleState: mapScale.state

38
    // The following properties must be set by the consumer
39
    property var    planMasterController
40
    property var    wimaController
41
    property var    guidedActionsController
Don Gagne's avatar
Don Gagne committed
42
    property var    flightWidgets
43
    property var    rightPanelWidth
44
    property var    qgcView                             ///< QGCView control which contains this map
45
    property var    multiVehicleView                    ///< true: multi-vehicle view, false: single vehicle view
Don Gagne's avatar
Don Gagne committed
46

47 48
    property rect   centerViewport:             Qt.rect(0, 0, width, height)

49 50 51 52
    property var    _planMasterController:      planMasterController
    property var    _missionController:         _planMasterController.missionController
    property var    _geoFenceController:        _planMasterController.geoFenceController
    property var    _rallyPointController:      _planMasterController.rallyPointController
53 54 55
    property var    _activeVehicle:             QGroundControl.multiVehicleManager.activeVehicle
    property var    _activeVehicleCoordinate:   _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate()
    property real   _toolButtonTopMargin:       parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
Gus Grubba's avatar
Gus Grubba committed
56
    property bool   _airspaceEnabled:           QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
57

58 59
    property bool   _disableVehicleTracking:    false
    property bool   _keepVehicleCentered:       _mainIsMap ? false : true
60

61 62 63 64
    property bool   _wimaEnabled:               wimaController.enableWimaController.value
    property bool   _showAllWimaItems:          wimaController.showAllMissionItems.value
    property bool   _showCurrentWimaItems:      wimaController.showCurrentMissionItems.value

65
    function updateAirspace(reset) {
66
        if(_airspaceEnabled) {
67 68 69
            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) {
70
                QGroundControl.airspaceManager.setROI(coordinateNW, coordinateSE, false /*planView*/, reset)
71
            }
72
        }
73 74 75 76 77 78
    }

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

    onZoomLevelChanged: {
        QGroundControl.flightMapZoom = zoomLevel
79
        updateAirspace(false)
80 81
    }
    onCenterChanged: {
82
        QGroundControl.flightMapPosition = center
83
        updateAirspace(false)
84
    }
85

86
    // When the user pans the map we stop responding to vehicle coordinate updates until the panRecenterTimer fires
87
    onUserPannedChanged: {
DonLakeFlyer's avatar
DonLakeFlyer committed
88 89 90 91 92 93
        if (userPanned) {
            console.log("user panned")
            userPanned = false
            _disableVehicleTracking = true
            panRecenterTimer.restart()
        }
94 95
    }

Gus Grubba's avatar
Gus Grubba committed
96
    on_AirspaceEnabledChanged: {
97
        updateAirspace(true)
Gus Grubba's avatar
Gus Grubba committed
98 99
    }

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
    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() {
130
        var vehiclePoint = flightMap.fromCoordinate(_activeVehicleCoordinate, false /* clipToViewport */)
131 132
        var toolStripRightEdge = mapFromItem(toolStrip, toolStrip.x, 0).x + toolStrip.width
        var instrumentsWidth = 0
133
        if (QGroundControl.corePlugin.options.instrumentWidget && QGroundControl.corePlugin.options.instrumentWidget.widgetPosition === CustomInstrumentWidget.POS_TOP_RIGHT) {
134 135 136 137
            // Assume standard instruments
            instrumentsWidth = flightDisplayViewWidgets.getPreferredInstrumentWidth()
        }
        var centerViewport = Qt.rect(toolStripRightEdge, 0, width - toolStripRightEdge - instrumentsWidth, height)
138
        return !pointInRect(vehiclePoint, centerViewport)
139 140 141
    }

    function updateMapToVehiclePosition() {
142 143
        // We let FlightMap handle first vehicle position
        if (firstVehiclePositionReceived && _activeVehicleCoordinate.isValid && !_disableVehicleTracking) {
144
            if (_keepVehicleCentered) {
145
                flightMap.center = _activeVehicleCoordinate
146
            } else {
DonLakeFlyer's avatar
DonLakeFlyer committed
147
                if (firstVehiclePositionReceived && recenterNeeded()) {
148
                    animatedMapRecenter(flightMap.center, _activeVehicleCoordinate)
149 150
                }
            }
151 152 153 154
        }
    }

    Timer {
155 156 157
        id:         panRecenterTimer
        interval:   10000
        running:    false
158 159

        onTriggered: {
160
            _disableVehicleTracking = false
161
            updateMapToVehiclePosition()
162 163 164
        }
    }

165 166 167 168 169 170 171
    Timer {
        interval:       500
        running:        true
        repeat:         true
        onTriggered:    updateMapToVehiclePosition()
    }

Don Gagne's avatar
Don Gagne committed
172
    QGCPalette { id: qgcPal; colorGroupEnabled: true }
173
    QGCMapPalette { id: mapPal; lightColors: isSatelliteMap }
Don Gagne's avatar
Don Gagne committed
174

175
    Connections {
176
        target: _missionController
177 178

        onNewItemsFromVehicle: {
179
            var visualItems = _missionController.visualItems
180
            if (visualItems && visualItems.count !== 1) {
181 182 183
                if (recenterNeeded()){
                    mapFitFunctions.fitMapViewportToMissionItems()
                }
184
                firstVehiclePositionReceived = true
185 186
            }
        }
187 188
    }

189
    ExclusiveGroup {
Don Gagne's avatar
Don Gagne committed
190
        id: _mapTypeButtonsExclusiveGroup
191 192
    }

Don Gagne's avatar
Don Gagne committed
193
    MapFitFunctions {
194
        id:                         mapFitFunctions // The name for this id cannot be changed without breaking references outside of this code. Beware!
Don Gagne's avatar
Don Gagne committed
195 196
        map:                        _flightMap
        usePlannedHomePosition:     false
197
        planMasterController:       _planMasterController
198

Don Gagne's avatar
Don Gagne committed
199 200
        property real leftToolWidth:    toolStrip.x + toolStrip.width
    }
201

202
    // Add wima Areas to the Map
203
    MapItemView {
204 205 206
        property bool _enableWima: wimaController.enableWimaController.value

        model: _enableWima ? wimaController.visualItems : 0
207 208 209 210

        delegate: MapPolygon{
            path:           object.path;
            border.color:   "black"
211 212 213 214
            color:          object.type === "WimaJoinedAreaData" ? "gray"
                                : object.type === "WimaServiceAreaData" ? "yellow"
                                    : object.type === "WimaMeasurementAreaData" ? "green"
                                        : "transparent"
215
            opacity:        0.25
216
            z:              0
217
        }
218 219
    }

220
    // Add mission items generated by wima planer to the map
Valentin Platzgummer's avatar
Valentin Platzgummer committed
221
    // all Items
222 223 224 225 226 227
    WimaPlanMapItems {
        map:            flightMap
        largeMapView:   _mainIsMap
        missionItems:   wimaController.missionItems
        path:           wimaController.waypointPath
        showItems:      _wimaEnabled && _showAllWimaItems
228 229
        zOrderWP:       QGroundControl.zOrderWimaAllWaypointIndicators
        zOrderLines:    QGroundControl.zOrderWimaAllWaypointLines
Valentin Platzgummer's avatar
Valentin Platzgummer committed
230
        color:          "gray"
231
    }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
232
    // current Items
233 234 235 236 237 238
    WimaPlanMapItems {
        map:            flightMap
        largeMapView:   _mainIsMap
        missionItems:   wimaController.currentMissionItems
        path:           wimaController.currentWaypointPath
        showItems:      _wimaEnabled && _showCurrentWimaItems
239 240
        zOrderWP:       QGroundControl.zOrderWimaCurrentWaypointIndicators
        zOrderLines:    QGroundControl.zOrderWimaCurrentWaypointLines
241
        color:          "green"
242 243
    }

244
    // Add Snake tile center points to the map
245 246 247 248 249
    MapItemView {
        property bool _enable:    wimaController.enableWimaController.value
                               && wimaController.enableSnake.value
        model: _enable ? wimaController.snakeTileCenterPoints : 0

250 251 252 253 254
        delegate: ProgressIndicator{
            coordinate:         modelData
            currentValue:   getProgress()
            width:          10
            height:         10
255 256
            z:              1

257 258 259 260 261 262 263
            function getProgress() {
                var progress = wimaController.nemoProgress[index]
                if (progress < 0)
                    progress = 0
                if (progress > 100)
                    progress = 100
                return progress
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
            }
        }
    }

    // Add Snake tiles to the map
    MapItemView {
        property bool _enable:    wimaController.enableWimaController.value
                               && wimaController.enableSnake.value
        model: _enable ? wimaController.snakeTiles : 0

        delegate: MapPolygon{
            path:           object.path;
            border.color:   "black"
            border.width:   1
            color:          "transparent"
            opacity:        1
            z:              2
        }
    }

284 285
    // Add trajectory points to the map
    MapItemView {
286
        model: _mainIsMap ? _activeVehicle ? _activeVehicle.trajectoryPoints : 0 : 0
DonLakeFlyer's avatar
DonLakeFlyer committed
287 288

        delegate: MapPolyline {
Don Gagne's avatar
Don Gagne committed
289 290
            line.width: 3
            line.color: "red"
DonLakeFlyer's avatar
DonLakeFlyer committed
291
            z:          QGroundControl.zOrderTrajectoryLines
Don Gagne's avatar
Don Gagne committed
292
            path: [
293 294
                object.coordinate1,
                object.coordinate2,
Don Gagne's avatar
Don Gagne committed
295 296
            ]
        }
297 298 299 300
    }

    // Add the vehicles to the map
    MapItemView {
301
        model: QGroundControl.multiVehicleManager.vehicles
DonLakeFlyer's avatar
DonLakeFlyer committed
302 303

        delegate: VehicleMapItem {
Don Gagne's avatar
Don Gagne committed
304 305
            vehicle:        object
            coordinate:     object.coordinate
306
            map:            flightMap
Gus Grubba's avatar
Gus Grubba committed
307
            size:           _mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
DonLakeFlyer's avatar
DonLakeFlyer committed
308
            z:              QGroundControl.zOrderVehicles
Don Gagne's avatar
Don Gagne committed
309
        }
310 311
    }

312 313
    // Add ADSB vehicles to the map
    MapItemView {
Gus Grubba's avatar
Gus Grubba committed
314
        model: _activeVehicle ? _activeVehicle.adsbVehicles : []
315 316 317 318
        property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
        delegate: VehicleMapItem {
            coordinate:     object.coordinate
            altitude:       object.altitude
319
            callsign:       object.callsign
320
            heading:        object.heading
Gus Grubba's avatar
Gus Grubba committed
321
            alert:          object.alert
322 323 324 325 326
            map:            flightMap
            z:              QGroundControl.zOrderVehicles
        }
    }

327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343
    // Add the items associated with each vehicles flight plan to the map
    Repeater {
        model: QGroundControl.multiVehicleManager.vehicles

        PlanMapItems {
            map:                flightMap
            largeMapView:       _mainIsMap
            masterController:   masterController
            isActiveVehicle:    _vehicle.active

            property var _vehicle: object

            PlanMasterController {
                id: masterController
                Component.onCompleted: startStaticActiveVehicle(object)
            }
        }
344 345
    }

346 347 348 349 350 351
    // Allow custom builds to add map items
    CustomMapItems {
        map:            flightMap
        largeMapView:   _mainIsMap
    }

352 353
    GeoFenceMapVisuals {
        map:                    flightMap
354
        myGeoFenceController:   _geoFenceController
355
        interactive:            false
356
        planView:               false
357
        homePosition:           _activeVehicle && _activeVehicle.homePosition.isValid ? _activeVehicle.homePosition :  QtPositioning.coordinate()
358 359
    }

360 361
    // Rally points on map
    MapItemView {
362
        model: _rallyPointController.points
363 364 365

        delegate: MapQuickItem {
            id:             itemIndicator
366 367
            anchorPoint.x:  sourceItem.anchorPointX
            anchorPoint.y:  sourceItem.anchorPointY
368 369 370 371 372 373 374 375 376 377
            coordinate:     object.coordinate
            z:              QGroundControl.zOrderMapItems

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

DonLakeFlyer's avatar
DonLakeFlyer committed
378 379 380 381 382 383 384 385 386 387
    // Camera trigger points
    MapItemView {
        model: _activeVehicle ? _activeVehicle.cameraTriggerPoints : 0

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

388
    // GoTo Location visuals
Don Gagne's avatar
Don Gagne committed
389
    MapQuickItem {
390 391
        id:             gotoLocationItem
        visible:        false
Don Gagne's avatar
Don Gagne committed
392
        z:              QGroundControl.zOrderMapItems
393 394
        anchorPoint.x:  sourceItem.anchorPointX
        anchorPoint.y:  sourceItem.anchorPointY
Don Gagne's avatar
Don Gagne committed
395 396

        sourceItem: MissionItemIndexLabel {
DonLakeFlyer's avatar
DonLakeFlyer committed
397 398 399
            checked:    true
            index:      -1
            label:      qsTr("Goto here", "Goto here waypoint")
Don Gagne's avatar
Don Gagne committed
400
        }
401

402
        property bool inGotoFlightMode: _activeVehicle ? _activeVehicle.flightMode === _activeVehicle.gotoFlightMode : false
403
        property var activeVehicle: _activeVehicle
404 405 406 407 408 409 410 411

        onInGotoFlightModeChanged: {
            if (!inGotoFlightMode && visible) {
                // Hide goto indicator when vehicle falls out of guided mode
                visible = false
            }
        }

412 413 414 415 416 417
        onActiveVehicleChanged: {
            if (!_activeVehicle) {
                visible = false
            }
        }

418 419 420 421
        function show(coord) {
            gotoLocationItem.coordinate = coord
            gotoLocationItem.visible = true
        }
422

423 424 425 426
        function hide() {
            gotoLocationItem.visible = false
        }

427 428 429 430 431 432 433 434
        function actionConfirmed() {
            // We leave the indicator visible. The handling for onInGuidedModeChanged will hide it.
        }

        function actionCancelled() {
            hide()
        }
    }
435

436
    // Orbit editing visuals
437
    QGCMapCircleVisuals {
438 439 440 441
        id:             orbitMapCircle
        mapControl:     parent
        mapCircle:      _mapCircle
        visible:        false
442

443 444
        property alias center:              _mapCircle.center
        property alias clockwiseRotation:   _mapCircle.clockwiseRotation
445
        property var   activeVehicle:       _activeVehicle
446 447 448

        readonly property real defaultRadius: 30

449 450 451 452 453 454
        onActiveVehicleChanged: {
            if (!_activeVehicle) {
                visible = false
            }
        }

455
        function show(coord) {
DonLakeFlyer's avatar
DonLakeFlyer committed
456
            _mapCircle.radius.rawValue = defaultRadius
457 458 459 460 461 462 463 464
            orbitMapCircle.center = coord
            orbitMapCircle.visible = true
        }

        function hide() {
            orbitMapCircle.visible = false
        }

465 466 467 468 469 470 471 472 473
        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
474 475 476 477
        function radius() {
            return _mapCircle.radius.rawValue
        }

478 479 480 481 482
        Component.onCompleted: guidedActionsController.orbitMapCircle = orbitMapCircle

        QGCMapCircle {
            id:                 _mapCircle
            interactive:        true
DonLakeFlyer's avatar
DonLakeFlyer committed
483
            radius.rawValue:    30
484 485
            showRotation:       true
            clockwiseRotation:  true
486 487 488
        }
    }

489
    // Orbit telemetry visuals
490
    QGCMapCircleVisuals {
491
        id:             orbitTelemetryCircle
492
        mapControl:     parent
Gus Grubba's avatar
Gus Grubba committed
493
        mapCircle:      _activeVehicle ? _activeVehicle.orbitMapCircle : null
494 495 496
        visible:        _activeVehicle ? _activeVehicle.orbitActive : false
    }

497 498 499 500
    MapQuickItem {
        id:             orbitCenterIndicator
        anchorPoint.x:  sourceItem.anchorPointX
        anchorPoint.y:  sourceItem.anchorPointY
Don Gagne's avatar
Don Gagne committed
501
        coordinate:     _activeVehicle ? _activeVehicle.orbitMapCircle.center : QtPositioning.coordinate()
502 503 504 505 506 507 508 509 510
        visible:        orbitTelemetryCircle.visible

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

Don Gagne's avatar
Don Gagne committed
511
    // Handle guided mode clicks
512 513
    MouseArea {
        anchors.fill: parent
Don Gagne's avatar
Don Gagne committed
514

DonLakeFlyer's avatar
DonLakeFlyer committed
515 516 517
        Menu {
            id: clickMenu

518 519
            property var coord

DonLakeFlyer's avatar
DonLakeFlyer committed
520 521 522 523 524
            MenuItem {
                text:           qsTr("Go to location")
                visible:        guidedActionsController.showGotoLocation

                onTriggered: {
525 526
                    gotoLocationItem.show(clickMenu.coord)
                    orbitMapCircle.hide()
527
                    guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickMenu.coord, gotoLocationItem)
DonLakeFlyer's avatar
DonLakeFlyer committed
528 529 530 531 532 533
                }
            }

            MenuItem {
                text:           qsTr("Orbit at location")
                visible:        guidedActionsController.showOrbit
534

DonLakeFlyer's avatar
DonLakeFlyer committed
535
                onTriggered: {
536 537
                    orbitMapCircle.show(clickMenu.coord)
                    gotoLocationItem.hide()
538
                    guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickMenu.coord, orbitMapCircle)
DonLakeFlyer's avatar
DonLakeFlyer committed
539 540 541 542
                }
            }
        }

Don Gagne's avatar
Don Gagne committed
543
        onClicked: {
DonLakeFlyer's avatar
DonLakeFlyer committed
544 545
            if (guidedActionsController.guidedUIVisible || (!guidedActionsController.showGotoLocation && !guidedActionsController.showOrbit)) {
                return
Gus Grubba's avatar
Gus Grubba committed
546
            }
547 548 549
            orbitMapCircle.hide()
            gotoLocationItem.hide()
            var clickCoord = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
DonLakeFlyer's avatar
DonLakeFlyer committed
550
            if (guidedActionsController.showGotoLocation && guidedActionsController.showOrbit) {
551
                clickMenu.coord = clickCoord
DonLakeFlyer's avatar
DonLakeFlyer committed
552 553
                clickMenu.popup()
            } else if (guidedActionsController.showGotoLocation) {
DonLakeFlyer's avatar
DonLakeFlyer committed
554
                gotoLocationItem.show(clickCoord)
555
                guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickCoord)
DonLakeFlyer's avatar
DonLakeFlyer committed
556
            } else if (guidedActionsController.showOrbit) {
557 558
                orbitMapCircle.show(clickCoord)
                guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickCoord)
Don Gagne's avatar
Don Gagne committed
559 560
            }
        }
561
    }
562 563

    MapScale {
564
        id:                     mapScale
565
        anchors.right:          parent.right
566 567 568
        anchors.margins:        ScreenTools.defaultFontPixelHeight * (0.33)
        anchors.topMargin:      ScreenTools.defaultFontPixelHeight * (0.33) + state === "bottomMode" ? 0 : ScreenTools.toolbarHeight
        anchors.bottomMargin:   ScreenTools.defaultFontPixelHeight * (0.33)
569 570
        mapControl:             flightMap
        visible:                !ScreenTools.isTinyScreen
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
        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
                }
            }
        ]
590
    }
591

592
    // Airspace overlap support
593
    MapItemView {
594
        model:              _airspaceEnabled && QGroundControl.settingsManager.airMapSettings.enableAirspace && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.circles : []
595 596 597
        delegate: MapCircle {
            center:         object.center
            radius:         object.radius
598
            color:          object.color
Gus Grubba's avatar
Gus Grubba committed
599 600
            border.color:   object.lineColor
            border.width:   object.lineWidth
601 602 603 604
        }
    }

    MapItemView {
605
        model:              _airspaceEnabled && QGroundControl.settingsManager.airMapSettings.enableAirspace && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.polygons : []
606 607
        delegate: MapPolygon {
            path:           object.polygon
608
            color:          object.color
Gus Grubba's avatar
Gus Grubba committed
609 610
            border.color:   object.lineColor
            border.width:   object.lineWidth
611 612
        }
    }
613

614
}