1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 14:21:49 -05:00
sdrangel/sdrgui/resources/map.qml
Jon Beniston 1a9b6d1763 Add ADS-B Demodulator plugin.
Add GS232 Rotator Controller feature plugin.
Add altitude and station name to My Positon.
Use QtDeploy to ensure all required Qt libraries are included (Should
fix OpenGL issues)
2020-10-27 16:22:10 +00:00

86 lines
2.1 KiB
QML

import QtQuick 2.4
import QtQuick.Window 2.4
import QtLocation 5.6
import QtPositioning 5.6
Item {
id: qmlMap
property int aircraftZoomLevel: 11
Plugin {
id: mapPlugin
name: "osm"
}
Map {
id: map
objectName: "map"
anchors.fill: parent
plugin: mapPlugin
center: QtPositioning.coordinate(51.5, 0.125) // London
zoomLevel: 10
MapStation {
id: station
objectName: "station"
stationName: "Home"
coordinate: QtPositioning.coordinate(51.5, 0.125)
}
MapItemView{
model: aircraftModel
delegate: aircraftComponent
}
onZoomLevelChanged: {
if (zoomLevel > 11) {
station.zoomLevel = zoomLevel
aircraftZoomLevel = zoomLevel
} else {
station.zoomLevel = 11
aircraftZoomLevel = 11
}
}
}
Component {
id: aircraftComponent
MapQuickItem {
id: aircraft
anchorPoint.x: image.width/2
anchorPoint.y: image.height/2
coordinate: position
zoomLevel: aircraftZoomLevel
sourceItem: Grid {
columns: 1
Grid {
horizontalItemAlignment: Grid.AlignHCenter
Image {
id: image
rotation: heading
source: aircraftImage
}
Rectangle {
id: bubble
color: bubbleColour
border.width: 1
width: text.width * 1.1
height: text.height * 1.1
radius: 5
Text {
id: text
anchors.centerIn: parent
text: adsbData
}
}
}
}
}
}
}