summaryrefslogtreecommitdiffstats
path: root/app/navigation.qml
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-09-22 20:38:07 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-09-24 19:33:14 -0700
commit8347e7ed9fc117e1d10ea5071cbbfc62b7000577 (patch)
tree178dd7ecf1a1445f27c85e1a3013ee42db14cf04 /app/navigation.qml
parentaca9ff0527349d07c7547893d28a3ace89d6edd9 (diff)
qml: allow map plugins to be set on runtime
Allow selection of OSM over MapBox with enableOSM configuration file option. Bug-AGL: SPEC-2667 Change-Id: Ie055ca1263b0a6f2a74046e5ff85535e48e60d31 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/navigation.qml')
-rwxr-xr-xapp/navigation.qml30
1 files changed, 19 insertions, 11 deletions
diff --git a/app/navigation.qml b/app/navigation.qml
index c4eba78..de08bf6 100755
--- a/app/navigation.qml
+++ b/app/navigation.qml
@@ -39,6 +39,23 @@ ApplicationWindow {
property real positionTimer_interval : fileOperation.getUpdateInterval() // set millisecond
property real car_moving_distance : (car_driving_speed / 3.6) / (1000/positionTimer_interval) // Metric unit
+ Plugin {
+ id: mapbox
+ name: "mapbox"
+ PluginParameter {
+ name: "mapbox.access_token";
+ value: fileOperation.getMapAccessToken()
+ }
+ }
+ Plugin {
+ id: osm
+ name: "osm"
+ PluginParameter {
+ name: "osm.mapping.host";
+ value: "https://a.tile.openstreetmap.org/"
+ }
+ }
+
Map{
id: map
property int pathcounter : 0
@@ -60,11 +77,7 @@ ApplicationWindow {
width: parent.width
height: parent.height
- plugin: Plugin {
- name: "mapbox"
- PluginParameter { name: "mapbox.access_token";
- value: fileOperation.getMapAccessToken() }
- }
+ plugin: fileOperation.isOSMEnabled() ? osm : mapbox
center: QtPositioning.coordinate(car_position_lat, car_position_lon)
zoomLevel: default_zoom_level
bearing: 0
@@ -214,12 +227,7 @@ ApplicationWindow {
RouteModel {
id: routeModel
objectName: "routeModel"
- plugin : Plugin {
- name: "mapbox"
- PluginParameter { name: "mapbox.access_token";
- value: fileOperation.getMapAccessToken()
- }
- }
+ plugin: map.plugin
query: RouteQuery {
id: routeQuery
}