In Qt6, Map just shows a static map, while MapView allows for zooming, moving, etc.
This commit is contained in:
Tobias Fella
2023-10-23 20:36:27 +02:00
parent cfc5202645
commit 19e197e0ec
5 changed files with 53 additions and 27 deletions

View File

@@ -25,16 +25,15 @@ MessageDelegate {
id: liveLocationModel
eventId: root.eventId
}
Map {
id: map
MapView {
id: mapView
Layout.fillWidth: true
Layout.preferredHeight: root.contentMaxWidth / 16 * 9
center: QtPositioning.coordinate(liveLocationModel.boundingBox.y, liveLocationModel.boundingBox.x)
zoomLevel: 15
map.center: QtPositioning.coordinate(liveLocationModel.boundingBox.y, liveLocationModel.boundingBox.x)
map.zoomLevel: 15
plugin: OsmLocationPlugin.plugin
onCopyrightLinkActivated: Qt.openUrlExternally(link)
map.plugin: OsmLocationPlugin.plugin
MapItemView {
model: liveLocationModel
@@ -53,6 +52,12 @@ MessageDelegate {
acceptedButtons: Qt.RightButton
onTapped: openMessageContext("")
}
Connections {
target: mapView.map
function onCopyrightLinkActivated() {
Qt.openUrlExternally(link)
}
}
}
Component {
id: fullScreenMap