From 468f3b57c0a8a4b18a084822b3926ba7b6128a31 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 20 Jul 2017 02:51:34 +0300 Subject: mapwidget.qml: simplify the map type enumeration into "mapType" Make the "enumeration" local to the Map object for now. This will possibly break if another plugin is used in place of the ESRI plugin, but it will simplify the map toggle button which is about to be implemented next. If support for multiple plugins is added on runtime a simple helper function will be needed that will check the current plugin "name". And return the appropriate supportedMapTypes[X] for e.g. STREET of that plugin. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qml/MapWidget.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 8ba9853c9..163579e7e 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -5,8 +5,6 @@ import QtPositioning 5.3 import org.subsurfacedivelog.mobile 1.0 Item { - readonly property var esriMapTypeIndexes: { "STREET": 0, "SATELLITE": 1 } - Plugin { id: mapPlugin name: "esri" @@ -23,6 +21,7 @@ Item { plugin: mapPlugin zoomLevel: 1 + readonly property var mapType: { "STREET": supportedMapTypes[0], "SATELLITE": supportedMapTypes[1] } readonly property var defaultCenter: QtPositioning.coordinate(0, 0) readonly property var defaultZoomIn: 17.0 readonly property var defaultZoomOut: 1.0 @@ -30,7 +29,7 @@ Item { property var newZoom: 1.0 Component.onCompleted: { - activeMapType = supportedMapTypes[esriMapTypeIndexes.SATELLITE] + activeMapType = mapType.SATELLITE } MapItemView { -- cgit v1.2.3-70-g09d2