diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-04-20 11:34:18 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-25 13:18:41 -0700 |
commit | 212da3d92fccc8c694ef069288dd833d2bef0259 (patch) | |
tree | b4a65a4ad094d030a3f8e860e0c91eae45766aa6 /map-widget | |
parent | cd474996948b7592ab2973b7f936320a663a914e (diff) | |
download | subsurface-212da3d92fccc8c694ef069288dd833d2bef0259.tar.gz |
maps: disable link to Google maps on iOS and Android
It appears that on those two platforms you now need a paid API key in order
to have this feature work. Certainly not something I'm going to do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'map-widget')
-rw-r--r-- | map-widget/qml/MapWidgetContextMenu.qml | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/map-widget/qml/MapWidgetContextMenu.qml b/map-widget/qml/MapWidgetContextMenu.qml index 852eddd73..2ba8080c6 100644 --- a/map-widget/qml/MapWidgetContextMenu.qml +++ b/map-widget/qml/MapWidgetContextMenu.qml @@ -6,16 +6,16 @@ Item { signal actionSelected(int action) readonly property var actions: { - "OPEN_LOCATION_IN_GOOGLE_MAPS": 0, - "COPY_LOCATION_DECIMAL": 1, - "COPY_LOCATION_SEXAGESIMAL": 2, - "SELECT_VISIBLE_LOCATIONS": 3 + "COPY_LOCATION_DECIMAL": 0, + "COPY_LOCATION_SEXAGESIMAL": 1, + "SELECT_VISIBLE_LOCATIONS": 2, + "OPEN_LOCATION_IN_GOOGLE_MAPS": 3 } readonly property var menuItemData: [ - { idx: actions.OPEN_LOCATION_IN_GOOGLE_MAPS, itemText: qsTr("Open in Google Maps") }, { idx: actions.COPY_LOCATION_DECIMAL, itemText: qsTr("Copy coordinates to clipboard (decimal)") }, { idx: actions.COPY_LOCATION_SEXAGESIMAL, itemText: qsTr("Copy coordinates to clipboard (sexagesimal)") }, - { idx: actions.SELECT_VISIBLE_LOCATIONS, itemText: qsTr("Select visible dive locations") } + { idx: actions.SELECT_VISIBLE_LOCATIONS, itemText: qsTr("Select visible dive locations") }, + { idx: actions.OPEN_LOCATION_IN_GOOGLE_MAPS, itemText: qsTr("Open in Google Maps") } ] readonly property real itemTextPadding: 10.0 readonly property real itemHeight: 34.0 @@ -52,7 +52,12 @@ Item { id: listModel property int selectedIdx: -1 Component.onCompleted: { - for (var i = 0; i < menuItemData.length; i++) + var l = menuItemData.length + // don't offer Google map on iOS or Android (as the link doesn't + // work on those platforms without a paid API key) + if (Qt.platform.os === "android" || Qt.platform.os === "ios") + l-- + for (var i = 0; i < l; i++) append(menuItemData[i]); } } |