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

@@ -36,16 +36,15 @@ MessageDelegate {
required property string asset
bubbleContent: ColumnLayout {
Map {
id: map
MapView {
id: mapView
Layout.fillWidth: true
Layout.preferredHeight: root.contentMaxWidth / 16 * 9
center: QtPositioning.coordinate(root.latitude, root.longitude)
zoomLevel: 15
map.center: QtPositioning.coordinate(root.latitude, root.longitude)
map.zoomLevel: 15
plugin: OsmLocationPlugin.plugin
onCopyrightLinkActivated: Qt.openUrlExternally(link)
map.plugin: OsmLocationPlugin.plugin
LocationMapItem {
latitude: root.latitude
@@ -68,6 +67,12 @@ MessageDelegate {
acceptedButtons: Qt.RightButton
onTapped: openMessageContext("")
}
Connections {
target: mapView.map
function onCopyrightLinkActivated() {
Qt.openUrlExternally(link)
}
}
}
Component {
id: fullScreenMap