Don't show the map if there's no locations available

It's hard to the read the text when there's a beige map behind it, and
unnecessary anyway.

(cherry picked from commit f278cc0c86)
This commit is contained in:
Joshua Goins
2024-06-08 09:38:49 -04:00
parent 321bc293f3
commit e7fe65bf57

View File

@@ -21,6 +21,7 @@ Kirigami.Page {
id: mapView
anchors.fill: parent
map.plugin: OsmLocationPlugin.plugin
visible: mapView.map.mapItems.length !== 0
map.center: {
let c = LocationHelper.center(LocationHelper.unite(locationsModel.boundingBox, liveLocationsModel.boundingBox));
@@ -52,11 +53,6 @@ Kirigami.Page {
delegate: LocationMapItem {}
}
Kirigami.PlaceholderMessage {
text: i18n("There are no locations shared in this room.")
visible: mapView.map.mapItems.length === 0
anchors.centerIn: parent
}
Connections {
target: mapView.map
function onCopyrightLinkActivated() {
@@ -64,4 +60,10 @@ Kirigami.Page {
}
}
}
Kirigami.PlaceholderMessage {
text: i18n("There are no locations shared in this room.")
visible: mapView.map.mapItems.length === 0
anchors.centerIn: parent
}
}