Unify map markers on the full screen and room maps as well

This commit is contained in:
Volker Krause
2023-06-17 14:43:18 +02:00
parent b56ebdf149
commit 7f067b698e
3 changed files with 14 additions and 31 deletions

View File

@@ -11,7 +11,10 @@ import org.kde.kirigami 2.15 as Kirigami
ApplicationWindow { ApplicationWindow {
id: root id: root
required property var content required property real latitude
required property real longitude
required property string asset
required property var author
flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground
visibility: Qt.WindowFullScreen visibility: Qt.WindowFullScreen
@@ -32,20 +35,15 @@ ApplicationWindow {
Map { Map {
id: map id: map
anchors.fill: parent anchors.fill: parent
property string latlong: root.content.geo_uri.split(':')[1] center: QtPositioning.coordinate(root.latitude, root.longitude)
property string latitude: latlong.split(',')[0]
property string longitude: latlong.split(',')[1]
center: QtPositioning.coordinate(latitude, longitude)
zoomLevel: 15 zoomLevel: 15
plugin: OsmLocationPlugin.plugin plugin: OsmLocationPlugin.plugin
MapCircle { LocationMapItem {
radius: 1500 / map.zoomLevel latitude: root.latitude
color: Kirigami.Theme.highlightColor longitude: root.longitude
border.color: Kirigami.Theme.linkColor asset: root.asset
border.width: Kirigami.Units.devicePixelRatio * 2 author: root.author
smooth: true isLive: true
opacity: 0.25
center: QtPositioning.coordinate(map.latitude, map.longitude)
} }
onCopyrightLinkActivated: { onCopyrightLinkActivated: {
Qt.openUrlExternally(link) Qt.openUrlExternally(link)

View File

@@ -27,22 +27,8 @@ Kirigami.Page {
model: LocationsModel { model: LocationsModel {
room: locationsPage.room room: locationsPage.room
} }
delegate: MapQuickItem { delegate: LocationMapItem {
id: point isLive: true
required property var longitude
required property var latitude
required property string text
anchorPoint.x: icon.width / 2
anchorPoint.y: icon.height / 2
coordinate: QtPositioning.coordinate(point.latitude, point.longitude)
autoFadeIn: false
sourceItem: Kirigami.Icon {
id: icon
width: height
height: Kirigami.Units.iconSizes.medium
source: "flag-blue"
}
} }
} }
} }

View File

@@ -36,7 +36,6 @@ TimelineContainer {
* a user's location. * a user's location.
*/ */
required property string asset required property string asset
required property var content
ColumnLayout { ColumnLayout {
Layout.maximumWidth: root.contentMaxWidth Layout.maximumWidth: root.contentMaxWidth
@@ -63,7 +62,7 @@ TimelineContainer {
TapHandler { TapHandler {
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onTapped: { onTapped: {
let map = fullScreenMap.createObject(parent, {content: root.content}); let map = fullScreenMap.createObject(parent, {latitude: root.latitude, longitude: root.longitude, asset: root.asset, author: root.author});
map.open() map.open()
} }
onLongPressed: openMessageContext("") onLongPressed: openMessageContext("")