9import QtQuick.Controls as QQC2
10import org.kde.kirigami as Kirigami
11import org.kde.kosmindoormap
12import org.kde.kosmindoorrouting
15 title: map.floorLevels.hasName(map.view.floorLevel) && isNaN(parseInt(map.floorLevels.name(map.view.floorLevel))) ? map.floorLevels.name(map.view.floorLevel) : ("Floor " +
map.floorLevels.name(
map.view.floorLevel));
16 property point coordinate
18 property alias debug: infoModel.debug
19 property alias mapHoverEnabled: hoverHandler.enabled
20 property RoutingController routingController
29 Kirigami.ColumnView.preventStealing:
true
33 icon.name:
"go-down-symbolic"
34 enabled:
map.floorLevels.hasFloorLevelBelow(
map.view.floorLevel)
35 onTriggered:
map.view.floorLevel =
map.floorLevels.floorLevelBelow(
map.view.floorLevel)
39 icon.name:
"go-up-symbolic"
40 enabled:
map.floorLevels.hasFloorLevelAbove(
map.view.floorLevel)
41 onTriggered:
map.view.floorLevel =
map.floorLevels.floorLevelAbove(
map.view.floorLevel)
46 OSMElementInformationModel {
48 allowOnlineContent:
true
53 id: elementDetailsSheet
55 regionCode: page.map.mapData.regionCode
56 timeZone: page.map.mapData.timeZone
59 FloorLevelChangeModel {
60 id: floorLevelChangeModel
61 currentFloorLevel:
map.view.floorLevel
62 floorLevelModel:
map.floorLevels
67 model: floorLevelChangeModel
68 onFloorLevelSelected: (
level) => {
map.view.floorLevel =
level; }
74 hoveredElement:
map.elementAt(
map.mapEventPointToScreen(hoverHandler.point))
78 anchors.left:
map.left
79 anchors.bottom:
map.bottom
80 width: 0.3 *
map.width
83 IndoorMapAttributionLabel {
84 anchors.right:
map.right
85 anchors.bottom:
map.bottom
90 property mapPointerEvent ev
92 text:
i18n(
"Navigate from here")
95 routingController.setStartPosition(contextMenu.ev.geoPosition.y, contextMenu.ev.geoPosition.x,
map.view.floorLevel);
96 routingController.searchRoute();
100 text:
i18n(
"Navigate to here")
101 icon.name: "map-symbolic"
103 routingController.setEndPosition(contextMenu.ev.geoPosition.y, contextMenu.ev.geoPosition.x,
map.view.floorLevel);
104 routingController.searchRoute();
108 id: contextMenuInfoAction
110 text:
i18n(
"Show information")
111 icon.name: "documentinfo"
112 onTriggered: elementDetailsSheet.open()
116 function showContextMenu(ev) {
117 infoModel.element = ev.element;
118 contextMenuInfoAction.enabled = !ev.element.
isNull && (infoModel.name !==
"" || infoModel.debug);
120 contextMenu.popup(map, ev.screenPosition);
126 if (!ev.element.isNull && (ev.button ===
Qt.LeftButton || ev.button === 0)) {
127 floorLevelChangeModel.element = ev.element;
128 if (floorLevelChangeModel.hasSingleLevelChange) {
129 showPassiveNotification(
"Switched to floor " + floorLevelChangeModel.destinationLevelName,
"short");
130 map.view.floorLevel = floorLevelChangeModel.destinationLevel;
132 }
else if (floorLevelChangeModel.hasMultipleLevelChanges) {
133 elevatorSheet.open();
137 infoModel.element = ev.element;
138 if (infoModel.name !=
"" || infoModel.debug) {
139 elementDetailsSheet.open();
144 if (ev.button ===
Qt.RightButton) {
149 onLongPressed: (ev) => {
156 acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
160 onCoordinateChanged:
map.mapLoader.loadForCoordinate(coordinate.y, coordinate.x);
QML item for displaying a train station or airport map.
QString i18n(const char *text, const TYPE &arg...)
QStringView level(QStringView ifopt)
const QList< QKeySequence > & shortcut(StandardShortcut id)
bool isNull() const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)