From 42551ddcdf41cb1b0bff62a8798f49c7f034c16a Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 8 Sep 2019 23:36:12 -0700 Subject: qml: breakout MapBox plugin references To allow placement of other mapping engines make a common MapPlugin competent. Bug-AGL: SPEC-2667 Change-Id: I7bb4ae600304db104f39feeba3f35f342452584e Signed-off-by: Matt Ranostay --- app/app.pro | 4 ++-- app/mapbox/MapPlugin.qml | 30 ++++++++++++++++++++++++++++++ app/mapbox/mapbox.qrc | 5 +++++ app/navigation.qml | 13 ++----------- 4 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 app/mapbox/MapPlugin.qml create mode 100644 app/mapbox/mapbox.qrc diff --git a/app/app.pro b/app/app.pro index 8783f53..9965675 100644 --- a/app/app.pro +++ b/app/app.pro @@ -26,7 +26,8 @@ SOURCES += main.cpp \ RESOURCES += \ navigation.qrc \ - images/images.qrc + images/images.qrc \ + mapbox/mapbox.qrc LIBS += $$OUT_PWD/../dbus_interface/libdbus_interface.a INCLUDEPATH += $$OUT_PWD/../dbus_interface @@ -35,4 +36,3 @@ include(app.pri) DISTFILES += - diff --git a/app/mapbox/MapPlugin.qml b/app/mapbox/MapPlugin.qml new file mode 100644 index 0000000..d0d3938 --- /dev/null +++ b/app/mapbox/MapPlugin.qml @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import QtQuick 2.6 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import QtLocation 5.9 +import QtPositioning 5.6 + +Plugin { + name: "mapbox" + PluginParameter { + name: "mapbox.access_token"; + value: fileOperation.getMapAccessToken() + } +} + diff --git a/app/mapbox/mapbox.qrc b/app/mapbox/mapbox.qrc new file mode 100644 index 0000000..9052f66 --- /dev/null +++ b/app/mapbox/mapbox.qrc @@ -0,0 +1,5 @@ + + + MapPlugin.qml + + diff --git a/app/navigation.qml b/app/navigation.qml index c4eba78..2ce1cb6 100755 --- a/app/navigation.qml +++ b/app/navigation.qml @@ -60,11 +60,7 @@ ApplicationWindow { width: parent.width height: parent.height - plugin: Plugin { - name: "mapbox" - PluginParameter { name: "mapbox.access_token"; - value: fileOperation.getMapAccessToken() } - } + plugin: MapPlugin { } center: QtPositioning.coordinate(car_position_lat, car_position_lon) zoomLevel: default_zoom_level bearing: 0 @@ -214,12 +210,7 @@ ApplicationWindow { RouteModel { id: routeModel objectName: "routeModel" - plugin : Plugin { - name: "mapbox" - PluginParameter { name: "mapbox.access_token"; - value: fileOperation.getMapAccessToken() - } - } + plugin: MapPlugin { } query: RouteQuery { id: routeQuery } -- cgit 1.2.3-korg