2017-07-16 23:04:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-12-24 19:06:43 +00:00
|
|
|
import QtQuick 2.5
|
2017-07-14 14:53:08 +00:00
|
|
|
import QtLocation 5.3
|
|
|
|
import QtPositioning 5.3
|
2017-07-16 00:01:54 +00:00
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
2017-07-14 14:53:08 +00:00
|
|
|
|
2017-07-14 21:55:29 +00:00
|
|
|
Item {
|
2017-08-12 00:58:26 +00:00
|
|
|
id: rootItem
|
2018-03-08 19:59:34 +00:00
|
|
|
property alias mapHelper: mapHelper
|
|
|
|
property alias map: map
|
|
|
|
|
|
|
|
signal selectedDivesChanged(var list)
|
2017-07-24 19:50:18 +00:00
|
|
|
|
2017-07-16 00:01:54 +00:00
|
|
|
MapWidgetHelper {
|
|
|
|
id: mapHelper
|
2017-07-16 20:59:09 +00:00
|
|
|
map: map
|
2017-07-27 21:09:25 +00:00
|
|
|
editMode: false
|
2018-03-08 19:59:34 +00:00
|
|
|
onSelectedDivesChanged: rootItem.selectedDivesChanged(list)
|
2017-07-27 21:09:25 +00:00
|
|
|
onEditModeChanged: editMessage.isVisible = editMode === true ? 1 : 0
|
2017-07-27 21:36:06 +00:00
|
|
|
onCoordinatesChanged: {}
|
2017-08-12 00:58:26 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
map.plugin = Qt.createQmlObject(pluginObject, rootItem)
|
|
|
|
map.mapType = { "STREET": map.supportedMapTypes[0], "SATELLITE": map.supportedMapTypes[1] }
|
|
|
|
map.activeMapType = map.mapType.SATELLITE
|
|
|
|
}
|
2017-07-16 00:01:54 +00:00
|
|
|
}
|
|
|
|
|
2017-07-14 14:53:08 +00:00
|
|
|
Map {
|
2017-07-15 21:56:54 +00:00
|
|
|
id: map
|
2017-07-14 14:53:08 +00:00
|
|
|
anchors.fill: parent
|
2017-10-27 10:39:03 +00:00
|
|
|
zoomLevel: defaultZoomIn
|
2017-07-15 21:56:54 +00:00
|
|
|
|
2017-08-12 00:58:26 +00:00
|
|
|
property var mapType
|
2017-07-19 21:09:53 +00:00
|
|
|
readonly property var defaultCenter: QtPositioning.coordinate(0, 0)
|
2017-07-27 21:25:48 +00:00
|
|
|
readonly property real defaultZoomIn: 12.0
|
2017-07-25 15:38:15 +00:00
|
|
|
readonly property real defaultZoomOut: 1.0
|
2017-07-31 19:50:04 +00:00
|
|
|
readonly property real textVisibleZoom: 11.0
|
2017-07-25 15:38:15 +00:00
|
|
|
readonly property real zoomStep: 2.0
|
2017-07-19 21:09:53 +00:00
|
|
|
property var newCenter: defaultCenter
|
2017-07-25 15:38:15 +00:00
|
|
|
property real newZoom: 1.0
|
2017-07-27 21:25:48 +00:00
|
|
|
property real newZoomOut: 1.0
|
2017-07-25 15:38:15 +00:00
|
|
|
property var clickCoord: QtPositioning.coordinate(0, 0)
|
2017-10-28 10:56:09 +00:00
|
|
|
property bool isReady: false
|
2017-07-16 22:16:27 +00:00
|
|
|
|
2017-10-28 10:56:09 +00:00
|
|
|
Component.onCompleted: isReady = true
|
|
|
|
onZoomLevelChanged: {
|
|
|
|
if (isReady)
|
|
|
|
mapHelper.calculateSmallCircleRadius(map.center)
|
|
|
|
}
|
2017-07-24 13:17:37 +00:00
|
|
|
|
2017-07-17 19:24:30 +00:00
|
|
|
MapItemView {
|
|
|
|
id: mapItemView
|
|
|
|
model: mapHelper.model
|
|
|
|
delegate: MapQuickItem {
|
2017-07-27 21:25:48 +00:00
|
|
|
id: mapItem
|
2017-07-17 19:24:30 +00:00
|
|
|
anchorPoint.x: 0
|
|
|
|
anchorPoint.y: mapItemImage.height
|
2017-07-17 19:36:55 +00:00
|
|
|
coordinate: model.coordinate
|
2019-08-30 16:09:37 +00:00
|
|
|
z: model.z
|
2017-10-15 18:19:29 +00:00
|
|
|
sourceItem: Image {
|
|
|
|
id: mapItemImage
|
2019-08-30 13:25:59 +00:00
|
|
|
source: model.pixmap
|
2017-10-15 18:19:29 +00:00
|
|
|
SequentialAnimation {
|
|
|
|
id: mapItemImageAnimation
|
|
|
|
PropertyAnimation { target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120 }
|
|
|
|
PropertyAnimation { target: mapItemImage; property: "scale"; from: 0.7; to: 1.0; duration: 80 }
|
|
|
|
}
|
|
|
|
MouseArea {
|
2019-08-31 21:24:21 +00:00
|
|
|
drag.target: (mapHelper.editMode && model.isSelected) ? mapItem : undefined
|
2017-10-15 18:19:29 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2019-08-30 15:38:54 +00:00
|
|
|
if (!mapHelper.editMode && model.divesite)
|
2019-08-30 10:38:25 +00:00
|
|
|
mapHelper.selectedLocationChanged(model.divesite)
|
2017-07-19 21:06:08 +00:00
|
|
|
}
|
2017-10-15 18:19:29 +00:00
|
|
|
onDoubleClicked: map.doubleClickHandler(mapItem.coordinate)
|
|
|
|
onReleased: {
|
2019-08-31 21:24:21 +00:00
|
|
|
if (mapHelper.editMode && model.isSelected) {
|
2019-05-01 22:09:59 +00:00
|
|
|
mapHelper.updateCurrentDiveSiteCoordinatesFromMap(model.divesite, mapItem.coordinate)
|
2017-07-27 21:25:48 +00:00
|
|
|
}
|
2017-07-25 20:43:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
// Text with a duplicate for shadow. DropShadow as layer effect is kind of slow here.
|
|
|
|
y: mapItemImage.y + mapItemImage.height
|
2017-07-27 21:25:48 +00:00
|
|
|
visible: map.zoomLevel >= map.textVisibleZoom
|
2017-07-25 20:43:18 +00:00
|
|
|
Text {
|
|
|
|
id: mapItemTextShadow
|
|
|
|
x: mapItemText.x + 2; y: mapItemText.y + 2
|
|
|
|
text: mapItemText.text
|
|
|
|
font.pointSize: mapItemText.font.pointSize
|
|
|
|
color: "black"
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
id: mapItemText
|
|
|
|
text: model.name
|
|
|
|
font.pointSize: 11.0
|
2019-08-31 21:24:21 +00:00
|
|
|
color: model.isSelected ? "white" : "lightgrey"
|
2017-07-19 21:06:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-18 23:36:59 +00:00
|
|
|
}
|
2017-07-17 19:24:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-27 21:25:48 +00:00
|
|
|
SequentialAnimation {
|
2017-07-19 22:33:15 +00:00
|
|
|
id: mapAnimationZoomIn
|
2017-07-16 22:16:27 +00:00
|
|
|
NumberAnimation {
|
2017-07-27 21:25:48 +00:00
|
|
|
target: map; property: "zoomLevel"; to: map.newZoomOut; duration: Math.abs(map.newZoomOut - map.zoomLevel) * 200
|
|
|
|
}
|
|
|
|
ParallelAnimation {
|
2017-11-27 14:09:49 +00:00
|
|
|
CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 2000; easing.type: Easing.OutCubic }
|
2017-07-27 21:25:48 +00:00
|
|
|
NumberAnimation {
|
2017-11-27 14:09:49 +00:00
|
|
|
target: map; property: "zoomLevel"; to: map.newZoom; duration: 2000
|
2017-07-27 21:25:48 +00:00
|
|
|
}
|
2017-07-16 22:16:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-25 15:34:24 +00:00
|
|
|
ParallelAnimation {
|
|
|
|
id: mapAnimationClick
|
2017-07-28 13:40:28 +00:00
|
|
|
CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 500 }
|
|
|
|
NumberAnimation { target: map; property: "zoomLevel"; to: map.newZoom; duration: 500 }
|
2017-07-25 15:34:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2017-11-25 22:10:08 +00:00
|
|
|
onPressed: { map.stopZoomAnimations(); mouse.accepted = false }
|
|
|
|
onWheel: { map.stopZoomAnimations(); wheel.accepted = false }
|
2017-07-25 15:34:24 +00:00
|
|
|
onDoubleClicked: map.doubleClickHandler(map.toCoordinate(Qt.point(mouseX, mouseY)))
|
|
|
|
}
|
|
|
|
|
|
|
|
function doubleClickHandler(coord) {
|
|
|
|
newCenter = coord
|
|
|
|
newZoom = zoomLevel + zoomStep
|
2017-07-25 15:55:36 +00:00
|
|
|
if (newZoom > maximumZoomLevel)
|
|
|
|
newZoom = maximumZoomLevel
|
2017-07-25 15:34:24 +00:00
|
|
|
mapAnimationClick.restart()
|
|
|
|
}
|
|
|
|
|
2017-08-06 23:13:25 +00:00
|
|
|
function pointIsVisible(pt) {
|
|
|
|
return !isNaN(pt.x)
|
|
|
|
}
|
|
|
|
|
2017-11-27 15:05:43 +00:00
|
|
|
function coordIsValid(coord) {
|
|
|
|
if (coord == null || isNaN(coord.latitude) || isNaN(coord.longitude) ||
|
|
|
|
(coord.latitude === 0.0 && coord.longitude === 0.0))
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-08-06 23:13:25 +00:00
|
|
|
function stopZoomAnimations() {
|
|
|
|
mapAnimationZoomIn.stop()
|
|
|
|
}
|
|
|
|
|
2017-07-27 20:46:54 +00:00
|
|
|
function centerOnCoordinate(coord) {
|
2017-08-06 23:13:25 +00:00
|
|
|
stopZoomAnimations()
|
2017-11-27 15:05:43 +00:00
|
|
|
if (!coordIsValid(coord)) {
|
|
|
|
console.warn("MapWidget.qml: centerOnCoordinate(): !coordIsValid()")
|
2017-11-27 15:13:57 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
var newZoomOutFound = false
|
|
|
|
var zoomStored = zoomLevel
|
|
|
|
var centerStored = QtPositioning.coordinate(center.latitude, center.longitude)
|
|
|
|
newZoomOut = zoomLevel
|
|
|
|
newCenter = coord
|
|
|
|
zoomLevel = Math.floor(zoomLevel)
|
|
|
|
while (zoomLevel > minimumZoomLevel) {
|
|
|
|
var pt = fromCoordinate(coord)
|
|
|
|
if (pointIsVisible(pt)) {
|
|
|
|
newZoomOut = zoomLevel
|
|
|
|
newZoomOutFound = true
|
|
|
|
break
|
2017-07-27 21:25:48 +00:00
|
|
|
}
|
2017-11-27 15:13:57 +00:00
|
|
|
zoomLevel -= 1.0
|
2017-07-27 21:25:48 +00:00
|
|
|
}
|
2017-11-27 15:13:57 +00:00
|
|
|
if (!newZoomOutFound)
|
|
|
|
newZoomOut = defaultZoomOut
|
|
|
|
zoomLevel = zoomStored
|
|
|
|
center = centerStored
|
|
|
|
newZoom = zoomStored
|
|
|
|
mapAnimationZoomIn.restart()
|
2017-07-16 21:25:19 +00:00
|
|
|
}
|
2017-07-19 21:29:42 +00:00
|
|
|
|
2017-08-06 23:18:09 +00:00
|
|
|
function centerOnRectangle(topLeft, bottomRight, centerRect) {
|
|
|
|
stopZoomAnimations()
|
|
|
|
if (newCenter.latitude === 0.0 && newCenter.longitude === 0.0) {
|
2017-10-23 14:04:33 +00:00
|
|
|
// Do nothing
|
2017-11-27 15:13:57 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
var centerStored = QtPositioning.coordinate(center.latitude, center.longitude)
|
|
|
|
var zoomStored = zoomLevel
|
|
|
|
var newZoomOutFound = false
|
|
|
|
newCenter = centerRect
|
|
|
|
// calculate zoom out
|
|
|
|
newZoomOut = zoomLevel
|
|
|
|
while (zoomLevel > minimumZoomLevel) {
|
|
|
|
var ptCenter = fromCoordinate(centerStored)
|
|
|
|
var ptCenterRect = fromCoordinate(centerRect)
|
|
|
|
if (pointIsVisible(ptCenter) && pointIsVisible(ptCenterRect)) {
|
|
|
|
newZoomOut = zoomLevel
|
|
|
|
newZoomOutFound = true
|
|
|
|
break
|
2017-08-06 23:18:09 +00:00
|
|
|
}
|
2017-11-27 15:13:57 +00:00
|
|
|
zoomLevel -= 1.0
|
|
|
|
}
|
|
|
|
if (!newZoomOutFound)
|
|
|
|
newZoomOut = defaultZoomOut
|
|
|
|
// calculate zoom in
|
|
|
|
center = newCenter
|
|
|
|
zoomLevel = Math.floor(maximumZoomLevel)
|
|
|
|
var diagonalRect = topLeft.distanceTo(bottomRight)
|
|
|
|
while (zoomLevel > minimumZoomLevel) {
|
|
|
|
var c0 = toCoordinate(Qt.point(0.0, 0.0))
|
|
|
|
var c1 = toCoordinate(Qt.point(width, height))
|
|
|
|
if (c0.distanceTo(c1) > diagonalRect) {
|
|
|
|
newZoom = zoomLevel - 2.0
|
|
|
|
break
|
2017-08-06 23:18:09 +00:00
|
|
|
}
|
2017-11-27 15:13:57 +00:00
|
|
|
zoomLevel -= 1.0
|
2017-08-06 23:18:09 +00:00
|
|
|
}
|
2017-11-27 15:13:57 +00:00
|
|
|
if (newZoom > defaultZoomIn)
|
|
|
|
newZoom = defaultZoomIn
|
|
|
|
zoomLevel = zoomStored
|
|
|
|
center = centerStored
|
|
|
|
mapAnimationZoomIn.restart()
|
2017-08-06 23:04:23 +00:00
|
|
|
}
|
|
|
|
|
2017-07-19 21:29:42 +00:00
|
|
|
function deselectMapLocation() {
|
2017-10-23 14:04:33 +00:00
|
|
|
stopZoomAnimations()
|
2017-07-19 21:29:42 +00:00
|
|
|
}
|
2017-07-20 02:24:18 +00:00
|
|
|
}
|
2017-07-20 00:07:47 +00:00
|
|
|
|
2017-07-27 21:09:25 +00:00
|
|
|
Rectangle {
|
|
|
|
id: editMessage
|
|
|
|
radius: padding
|
|
|
|
color: "#b08000"
|
|
|
|
border.color: "white"
|
|
|
|
x: (map.width - width) * 0.5; y: padding
|
|
|
|
width: editMessageText.width + padding * 2.0
|
|
|
|
height: editMessageText.height + padding * 2.0
|
|
|
|
visible: false
|
|
|
|
opacity: 0.0
|
|
|
|
property int isVisible: -1
|
|
|
|
property real padding: 10.0
|
|
|
|
onOpacityChanged: visible = opacity != 0.0
|
|
|
|
states: [
|
|
|
|
State { when: editMessage.isVisible === 1; PropertyChanges { target: editMessage; opacity: 1.0 }},
|
|
|
|
State { when: editMessage.isVisible === 0; PropertyChanges { target: editMessage; opacity: 0.0 }}
|
|
|
|
]
|
2017-07-28 13:40:28 +00:00
|
|
|
transitions: Transition { NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }}
|
2017-07-27 21:09:25 +00:00
|
|
|
Text {
|
|
|
|
id: editMessageText
|
|
|
|
y: editMessage.padding; x: editMessage.padding
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
color: "white"
|
|
|
|
font.pointSize: 11.0
|
|
|
|
text: qsTr("Drag the selected dive location")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-20 02:24:18 +00:00
|
|
|
Image {
|
|
|
|
id: toggleImage
|
|
|
|
x: 10; y: x
|
2017-07-31 19:43:19 +00:00
|
|
|
width: 40
|
|
|
|
height: 40
|
2017-11-29 09:57:08 +00:00
|
|
|
source: "qrc:///map-style-" + (map.activeMapType === map.mapType.SATELLITE ? "map" : "photo") + "-icon"
|
2017-07-20 02:24:18 +00:00
|
|
|
SequentialAnimation {
|
|
|
|
id: toggleImageAnimation
|
2017-07-28 13:40:28 +00:00
|
|
|
PropertyAnimation { target: toggleImage; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
|
|
|
|
PropertyAnimation { target: toggleImage; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
|
2017-07-20 02:24:18 +00:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
map.activeMapType = map.activeMapType === map.mapType.SATELLITE ? map.mapType.STREET : map.mapType.SATELLITE
|
|
|
|
toggleImageAnimation.restart()
|
2017-07-20 00:07:47 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-14 14:53:08 +00:00
|
|
|
}
|
2017-07-20 13:58:21 +00:00
|
|
|
|
2017-07-25 15:55:36 +00:00
|
|
|
Image {
|
|
|
|
id: imageZoomIn
|
|
|
|
x: 10 + (toggleImage.width - imageZoomIn.width) * 0.5; y: toggleImage.y + toggleImage.height + 10
|
2017-07-31 19:43:19 +00:00
|
|
|
width: 20
|
|
|
|
height: 20
|
2017-11-29 09:57:08 +00:00
|
|
|
source: "qrc:///zoom-in-icon"
|
2017-07-25 15:55:36 +00:00
|
|
|
SequentialAnimation {
|
|
|
|
id: imageZoomInAnimation
|
2017-07-28 13:40:28 +00:00
|
|
|
PropertyAnimation { target: imageZoomIn; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
|
|
|
|
PropertyAnimation { target: imageZoomIn; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
|
2017-07-25 15:55:36 +00:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2017-11-25 22:10:08 +00:00
|
|
|
map.stopZoomAnimations()
|
2017-07-25 15:55:36 +00:00
|
|
|
map.newCenter = map.center
|
|
|
|
map.newZoom = map.zoomLevel + map.zoomStep
|
|
|
|
if (map.newZoom > map.maximumZoomLevel)
|
|
|
|
map.newZoom = map.maximumZoomLevel
|
|
|
|
mapAnimationClick.restart()
|
|
|
|
imageZoomInAnimation.restart()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: imageZoomOut
|
|
|
|
x: imageZoomIn.x; y: imageZoomIn.y + imageZoomIn.height + 10
|
2017-11-29 09:57:08 +00:00
|
|
|
source: "qrc:///zoom-out-icon"
|
2017-07-31 19:43:19 +00:00
|
|
|
width: 20
|
|
|
|
height: 20
|
2017-07-25 15:55:36 +00:00
|
|
|
SequentialAnimation {
|
|
|
|
id: imageZoomOutAnimation
|
2017-07-28 13:40:28 +00:00
|
|
|
PropertyAnimation { target: imageZoomOut; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
|
|
|
|
PropertyAnimation { target: imageZoomOut; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
|
2017-07-25 15:55:36 +00:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2017-11-25 22:10:08 +00:00
|
|
|
map.stopZoomAnimations()
|
2017-07-25 15:55:36 +00:00
|
|
|
map.newCenter = map.center
|
|
|
|
map.newZoom = map.zoomLevel - map.zoomStep
|
|
|
|
mapAnimationClick.restart()
|
|
|
|
imageZoomOutAnimation.restart()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-14 18:06:13 +00:00
|
|
|
/*
|
|
|
|
* open coordinates in google maps while attempting to roughly preserve
|
|
|
|
* the zoom level. the mapping between the QML map zoom level and the
|
|
|
|
* Google Maps zoom level is done via exponential regression:
|
|
|
|
* y = a * exp(b * x)
|
|
|
|
*
|
|
|
|
* data set:
|
|
|
|
* qml (x) gmaps (y in meters)
|
|
|
|
* 21 257
|
|
|
|
* 15.313216749178913 3260
|
|
|
|
* 12.553216749178931 20436
|
|
|
|
* 11.11321674917894 52883
|
|
|
|
* 9.313216749178952 202114
|
|
|
|
* 7.51321674917896 737136
|
|
|
|
* 5.593216749178958 2495529
|
|
|
|
* 4.153216749178957 3895765
|
|
|
|
* 1.753216749178955 18999949
|
|
|
|
*/
|
2017-07-21 13:26:33 +00:00
|
|
|
function openLocationInGoogleMaps(latitude, longitude) {
|
2018-03-14 16:57:06 +00:00
|
|
|
var loc = latitude + "," + longitude
|
2020-04-20 01:46:40 +00:00
|
|
|
var poi = latitude + "+" + longitude
|
2018-03-14 18:06:13 +00:00
|
|
|
var x = map.zoomLevel
|
|
|
|
var a = 53864950.831693
|
|
|
|
var b = -0.60455861606547030630
|
|
|
|
var zoom = Math.floor(a * Math.exp(b * x))
|
2020-04-20 01:46:40 +00:00
|
|
|
var url = "https://www.google.com/maps/place/" + poi + "/@" + loc + "," + zoom + "m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0"
|
2017-07-21 13:26:33 +00:00
|
|
|
Qt.openUrlExternally(url)
|
2018-03-14 18:06:13 +00:00
|
|
|
console.log("openLocationInGoogleMaps() map.zoomLevel: " + x + ", url: " + url)
|
2017-07-21 13:26:33 +00:00
|
|
|
}
|
|
|
|
|
2017-07-20 13:58:21 +00:00
|
|
|
MapWidgetContextMenu {
|
|
|
|
id: contextMenu
|
2017-07-20 16:25:59 +00:00
|
|
|
y: 10; x: map.width - y
|
2017-07-20 22:28:58 +00:00
|
|
|
onActionSelected: {
|
|
|
|
switch (action) {
|
|
|
|
case contextMenu.actions.OPEN_LOCATION_IN_GOOGLE_MAPS:
|
2017-07-21 13:26:33 +00:00
|
|
|
openLocationInGoogleMaps(map.center.latitude, map.center.longitude)
|
2017-07-28 13:40:28 +00:00
|
|
|
break
|
2017-07-20 22:28:58 +00:00
|
|
|
case contextMenu.actions.COPY_LOCATION_DECIMAL:
|
2017-07-25 15:38:15 +00:00
|
|
|
mapHelper.copyToClipboardCoordinates(map.center, false)
|
2017-07-28 13:40:28 +00:00
|
|
|
break
|
2017-07-20 22:28:58 +00:00
|
|
|
case contextMenu.actions.COPY_LOCATION_SEXAGESIMAL:
|
2017-07-25 15:38:15 +00:00
|
|
|
mapHelper.copyToClipboardCoordinates(map.center, true)
|
2017-07-28 13:40:28 +00:00
|
|
|
break
|
2017-08-07 00:02:16 +00:00
|
|
|
case contextMenu.actions.SELECT_VISIBLE_LOCATIONS:
|
|
|
|
mapHelper.selectVisibleLocations()
|
|
|
|
break
|
2017-07-20 22:28:58 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-20 13:58:21 +00:00
|
|
|
}
|
2017-07-14 14:53:08 +00:00
|
|
|
}
|