diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-22 20:38:07 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-23 20:57:30 -0700 |
commit | b4364919e5a74325812f2f527adbfe62a165109e (patch) | |
tree | 2c3f1c5d14aec6318a3b009479ef8e37e6b46603 /app/navigation.qml | |
parent | 0cd23d5caf31753164b2bca64290e2b636a1999f (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')
-rw-r--r-- | app/navigation.qml | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/app/navigation.qml b/app/navigation.qml index c4eba78..de08bf6 100644 --- 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 } |