Warning, /pim/itinerary/src/app/MapView.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2019-2023 Volker Krause <vkrause@kde.org> 0003 SPDX-License-Identifier: LGPL-2.0-or-later 0004 */ 0005 0006 import QtQuick 0007 import QtQuick.Layouts 0008 import QtPositioning 0009 import QtLocation as QtLocation 0010 0011 0012 /** QtLocation map view with standard intercation settings. */ 0013 QtLocation.Map { 0014 id: map 0015 plugin: applicationWindow().osmPlugin() 0016 onCopyrightLinkActivated: Qt.openUrlExternally(link) 0017 0018 property geoCoordinate startCentroid 0019 PinchHandler { 0020 id: pinch 0021 target: null 0022 onActiveChanged: if (active) { 0023 map.startCentroid = map.toCoordinate(pinch.centroid.position, false) 0024 } 0025 onScaleChanged: (delta) => { 0026 map.zoomLevel += Math.log2(delta) 0027 map.alignCoordinateToPoint(map.startCentroid, pinch.centroid.position) 0028 } 0029 xAxis.enabled: false 0030 yAxis.enabled: false 0031 minimumRotation: 0.0 0032 maximumRotation: 0.0 0033 } 0034 WheelHandler { 0035 id: wheel 0036 rotationScale: 1/120 0037 orientation: Qt.Vertical 0038 acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad 0039 onWheel: (event) => { 0040 map.startCentroid = map.toCoordinate(wheel.point.position, false) 0041 map.zoomLevel += event.angleDelta.y * rotationScale 0042 map.alignCoordinateToPoint(map.startCentroid, wheel.point.position) 0043 } 0044 } 0045 DragHandler { 0046 id: drag 0047 target: null 0048 onTranslationChanged: (delta) => map.pan(-delta.x, -delta.y) 0049 } 0050 Shortcut { 0051 enabled: map.zoomLevel < map.maximumZoomLevel 0052 sequence: StandardKey.ZoomIn 0053 onActivated: map.zoomLevel = Math.round(map.zoomLevel + 1) 0054 } 0055 Shortcut { 0056 enabled: map.zoomLevel > map.minimumZoomLevel 0057 sequence: StandardKey.ZoomOut 0058 onActivated: map.zoomLevel = Math.round(map.zoomLevel - 1) 0059 } 0060 }