diff options
author | Bramastyo Harimukti <bramastyo.harimukti.santoso@pelagicore.com> | 2018-03-29 11:59:54 +0200 |
---|---|---|
committer | Lukáš Tinkl <ltinkl@luxoft.com> | 2018-04-03 09:34:39 +0000 |
commit | 74bb375174e8ce183aeeeeff9fe2bbb0f4fab080 (patch) | |
tree | e0bd967a7e6fdcc76f7c2211af221fa98f9d3a50 | |
parent | caf20588fcd750e89f2c832b012c1c535406ef50 (diff) |
[mapapp] Refactor the application
- rename to map application instead, since we dropped HERE map completely
there is no need to use qtlocation map anymore to avoid any confusion.
- clean-up left logics from the MapView and move them to the store.
Change-Id: I3732f4f35467a1a5e2f88d8a80e623e1031d69ad
Reviewed-by: Lukáš Tinkl <ltinkl@luxoft.com>
-rw-r--r-- | apps/com.pelagicore.map/Main.qml (renamed from apps/com.pelagicore.qtlocation/Main.qml) | 18 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/bg-home-navigation-overlay-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/bg-home-navigation-overlay.png (renamed from apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/floating-button-bg-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/floating-button-bg-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/floating-button-bg.png (renamed from apps/com.pelagicore.qtlocation/assets/floating-button-bg.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-3D_OFF-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-3D_OFF-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-3D_OFF.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-3D_OFF.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-3D_ON-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-3D_ON-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-3D_ON.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-3D_ON.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-end-route-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-end-route-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-end-route.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-end-route.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-home-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-home-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-home.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-home.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-my-position_OFF.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-my-position_OFF.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-my-position_ON.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-my-position_ON.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-search-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-search-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-search.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-search.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-start-navigation-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-start-navigation-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-start-navigation.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-start-navigation.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-work-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-work-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/ic-work.png (renamed from apps/com.pelagicore.qtlocation/assets/ic-work.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/navigation-widget-overlay-top-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/navigation-widget-overlay-top.png (renamed from apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-background-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-background-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-background.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-background.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-more-contrast-background-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-more-contrast-background.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-shadow-dark.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-shadow-dark.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/panel-shadow.png (renamed from apps/com.pelagicore.qtlocation/assets/panel-shadow.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/pin-destination.png (renamed from apps/com.pelagicore.qtlocation/assets/pin-destination.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/pin-your-position.png (renamed from apps/com.pelagicore.qtlocation/assets/pin-your-position.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/controls/MapSearchTextField.qml (renamed from apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/controls/MapToolButton.qml (renamed from apps/com.pelagicore.qtlocation/controls/MapToolButton.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/helpers/Helper.qml (renamed from apps/com.pelagicore.qtlocation/helpers/Helper.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/helpers/StandAlone.qml (renamed from apps/com.pelagicore.qtlocation/helpers/StandAlone.qml) | 0 | ||||
-rwxr-xr-x | apps/com.pelagicore.map/helpers/run-standalone.sh (renamed from apps/com.pelagicore.qtlocation/helpers/run-standalone.sh) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/icon.png (renamed from apps/com.pelagicore.qtlocation/icon.png) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/info.yaml (renamed from apps/com.pelagicore.qtlocation/info.yaml) | 2 | ||||
-rw-r--r-- | apps/com.pelagicore.map/maps/mapboxgl.db (renamed from apps/com.pelagicore.qtlocation/maps/mapboxgl.db) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/FavDestinationButtonsPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/HeaderBackgroundWidgetPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/MapBoxPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/MapHeaderPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/NavigationConfirmPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/NavigationSearchPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/SearchOverlayPanel.qml (renamed from apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml) | 0 | ||||
-rw-r--r-- | apps/com.pelagicore.map/stores/MapStore.qml (renamed from apps/com.pelagicore.qtlocation/stores/MapStore.qml) | 93 | ||||
-rw-r--r-- | apps/com.pelagicore.map/views/MapView.qml | 196 | ||||
-rw-r--r-- | apps/com.pelagicore.qtlocation/views/MapView.qml | 302 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/com.pelagicore.map.pro (renamed from plugins/com.pelagicore.qtlocation/com.pelagicore.qtlocation.pro) | 2 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/mapshelper.cpp (renamed from plugins/com.pelagicore.qtlocation/mapshelper.cpp) | 2 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/mapshelper.h (renamed from plugins/com.pelagicore.qtlocation/mapshelper.h) | 0 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/plugin.cpp (renamed from plugins/com.pelagicore.qtlocation/plugin.cpp) | 2 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/qmldir | 2 | ||||
-rw-r--r-- | plugins/com.pelagicore.qtlocation/qmldir | 2 | ||||
-rw-r--r-- | plugins/plugins.pro | 2 |
57 files changed, 305 insertions, 318 deletions
diff --git a/apps/com.pelagicore.qtlocation/Main.qml b/apps/com.pelagicore.map/Main.qml index de87e4e9..7fce4ee0 100644 --- a/apps/com.pelagicore.qtlocation/Main.qml +++ b/apps/com.pelagicore.map/Main.qml @@ -33,8 +33,8 @@ import QtQuick 2.9 import utils 1.0 import com.pelagicore.systeminfo 1.0 -import com.pelagicore.qtlocation 1.0 import com.pelagicore.styles.neptune 3.0 +import com.pelagicore.map 1.0 import QtApplicationManager 1.0 @@ -76,15 +76,16 @@ QtObject { MapView { id: mainMap - x: state === "Maximized" && !searchViewEnabled ? mainWindow.x : mainWindow.exposedRect.x - y: state === "Maximized" && !searchViewEnabled ? mainWindow.y : mainWindow.exposedRect.y - width: state === "Maximized" && !searchViewEnabled ? mainWindow.width : mainWindow.exposedRect.width - height: state === "Maximized" && !searchViewEnabled ? mainWindow.height : mainWindow.exposedRect.height + x: state === "Maximized" && !mainMap.store.searchViewEnabled ? mainWindow.x : mainWindow.exposedRect.x + y: state === "Maximized" && !mainMap.store.searchViewEnabled ? mainWindow.y : mainWindow.exposedRect.y + width: state === "Maximized" && !mainMap.store.searchViewEnabled ? mainWindow.width : mainWindow.exposedRect.width + height: state === "Maximized" && !mainMap.store.searchViewEnabled ? mainWindow.height : mainWindow.exposedRect.height state: mainWindow.neptuneState - offlineMapsEnabled: !sysinfo.online && Qt.platform.os === "linux" - mapInteractive: !searchViewEnabled + mapInteractive: !mainMap.store.searchViewEnabled store: MapStore { - currentLocationCoord: mainMap.currentLocation + offlineMapsEnabled: !sysinfo.online && Qt.platform.os === "linux" + currentLocationCoord: positionCoordinate + onOfflineMapsEnabledChanged: getAvailableMapsAndLocation() } onMapReadyChanged: { @@ -112,7 +113,6 @@ QtObject { mapZoomLevel: mainMap.mapZoomLevel mapTilt: mainMap.mapTilt mapBearing: mainMap.mapBearing - offlineMapsEnabled: mainMap.offlineMapsEnabled store: mainMap.store } } diff --git a/apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay-dark.png b/apps/com.pelagicore.map/assets/bg-home-navigation-overlay-dark.png index 4144983d..4144983d 100644 --- a/apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay-dark.png +++ b/apps/com.pelagicore.map/assets/bg-home-navigation-overlay-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay.png b/apps/com.pelagicore.map/assets/bg-home-navigation-overlay.png index e55cc3d1..e55cc3d1 100644 --- a/apps/com.pelagicore.qtlocation/assets/bg-home-navigation-overlay.png +++ b/apps/com.pelagicore.map/assets/bg-home-navigation-overlay.png diff --git a/apps/com.pelagicore.qtlocation/assets/floating-button-bg-dark.png b/apps/com.pelagicore.map/assets/floating-button-bg-dark.png index 1126861c..1126861c 100644 --- a/apps/com.pelagicore.qtlocation/assets/floating-button-bg-dark.png +++ b/apps/com.pelagicore.map/assets/floating-button-bg-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/floating-button-bg.png b/apps/com.pelagicore.map/assets/floating-button-bg.png index 0afbaf83..0afbaf83 100644 --- a/apps/com.pelagicore.qtlocation/assets/floating-button-bg.png +++ b/apps/com.pelagicore.map/assets/floating-button-bg.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-3D_OFF-dark.png b/apps/com.pelagicore.map/assets/ic-3D_OFF-dark.png index b844ebbd..b844ebbd 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-3D_OFF-dark.png +++ b/apps/com.pelagicore.map/assets/ic-3D_OFF-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-3D_OFF.png b/apps/com.pelagicore.map/assets/ic-3D_OFF.png index 09b67916..09b67916 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-3D_OFF.png +++ b/apps/com.pelagicore.map/assets/ic-3D_OFF.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-3D_ON-dark.png b/apps/com.pelagicore.map/assets/ic-3D_ON-dark.png index 1123a6fc..1123a6fc 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-3D_ON-dark.png +++ b/apps/com.pelagicore.map/assets/ic-3D_ON-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-3D_ON.png b/apps/com.pelagicore.map/assets/ic-3D_ON.png index 1123a6fc..1123a6fc 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-3D_ON.png +++ b/apps/com.pelagicore.map/assets/ic-3D_ON.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-end-route-dark.png b/apps/com.pelagicore.map/assets/ic-end-route-dark.png index a2bb7689..a2bb7689 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-end-route-dark.png +++ b/apps/com.pelagicore.map/assets/ic-end-route-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-end-route.png b/apps/com.pelagicore.map/assets/ic-end-route.png index 82e1e087..82e1e087 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-end-route.png +++ b/apps/com.pelagicore.map/assets/ic-end-route.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-home-dark.png b/apps/com.pelagicore.map/assets/ic-home-dark.png index 3111f17a..3111f17a 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-home-dark.png +++ b/apps/com.pelagicore.map/assets/ic-home-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-home.png b/apps/com.pelagicore.map/assets/ic-home.png index dc676f94..dc676f94 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-home.png +++ b/apps/com.pelagicore.map/assets/ic-home.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-my-position_OFF.png b/apps/com.pelagicore.map/assets/ic-my-position_OFF.png index e42b8231..e42b8231 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-my-position_OFF.png +++ b/apps/com.pelagicore.map/assets/ic-my-position_OFF.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-my-position_ON.png b/apps/com.pelagicore.map/assets/ic-my-position_ON.png index 619c6449..619c6449 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-my-position_ON.png +++ b/apps/com.pelagicore.map/assets/ic-my-position_ON.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-search-dark.png b/apps/com.pelagicore.map/assets/ic-search-dark.png index 908b2ffd..908b2ffd 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-search-dark.png +++ b/apps/com.pelagicore.map/assets/ic-search-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-search.png b/apps/com.pelagicore.map/assets/ic-search.png index b80683c3..b80683c3 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-search.png +++ b/apps/com.pelagicore.map/assets/ic-search.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-start-navigation-dark.png b/apps/com.pelagicore.map/assets/ic-start-navigation-dark.png index d767dba9..d767dba9 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-start-navigation-dark.png +++ b/apps/com.pelagicore.map/assets/ic-start-navigation-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-start-navigation.png b/apps/com.pelagicore.map/assets/ic-start-navigation.png index 06b6f66e..06b6f66e 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-start-navigation.png +++ b/apps/com.pelagicore.map/assets/ic-start-navigation.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-work-dark.png b/apps/com.pelagicore.map/assets/ic-work-dark.png index eef48559..eef48559 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-work-dark.png +++ b/apps/com.pelagicore.map/assets/ic-work-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/ic-work.png b/apps/com.pelagicore.map/assets/ic-work.png index b32a7e21..b32a7e21 100644 --- a/apps/com.pelagicore.qtlocation/assets/ic-work.png +++ b/apps/com.pelagicore.map/assets/ic-work.png diff --git a/apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top-dark.png b/apps/com.pelagicore.map/assets/navigation-widget-overlay-top-dark.png index c9fdec92..c9fdec92 100644 --- a/apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top-dark.png +++ b/apps/com.pelagicore.map/assets/navigation-widget-overlay-top-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top.png b/apps/com.pelagicore.map/assets/navigation-widget-overlay-top.png index eb8fa984..eb8fa984 100644 --- a/apps/com.pelagicore.qtlocation/assets/navigation-widget-overlay-top.png +++ b/apps/com.pelagicore.map/assets/navigation-widget-overlay-top.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-background-dark.png b/apps/com.pelagicore.map/assets/panel-background-dark.png index 960ce2bf..960ce2bf 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-background-dark.png +++ b/apps/com.pelagicore.map/assets/panel-background-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-background.png b/apps/com.pelagicore.map/assets/panel-background.png index 49605a42..49605a42 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-background.png +++ b/apps/com.pelagicore.map/assets/panel-background.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background-dark.png b/apps/com.pelagicore.map/assets/panel-more-contrast-background-dark.png index 1c969728..1c969728 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background-dark.png +++ b/apps/com.pelagicore.map/assets/panel-more-contrast-background-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background.png b/apps/com.pelagicore.map/assets/panel-more-contrast-background.png index 0623a5c9..0623a5c9 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-more-contrast-background.png +++ b/apps/com.pelagicore.map/assets/panel-more-contrast-background.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-shadow-dark.png b/apps/com.pelagicore.map/assets/panel-shadow-dark.png index 97e4af8b..97e4af8b 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-shadow-dark.png +++ b/apps/com.pelagicore.map/assets/panel-shadow-dark.png diff --git a/apps/com.pelagicore.qtlocation/assets/panel-shadow.png b/apps/com.pelagicore.map/assets/panel-shadow.png index 7be464c5..7be464c5 100644 --- a/apps/com.pelagicore.qtlocation/assets/panel-shadow.png +++ b/apps/com.pelagicore.map/assets/panel-shadow.png diff --git a/apps/com.pelagicore.qtlocation/assets/pin-destination.png b/apps/com.pelagicore.map/assets/pin-destination.png index 56795361..56795361 100644 --- a/apps/com.pelagicore.qtlocation/assets/pin-destination.png +++ b/apps/com.pelagicore.map/assets/pin-destination.png diff --git a/apps/com.pelagicore.qtlocation/assets/pin-your-position.png b/apps/com.pelagicore.map/assets/pin-your-position.png index f17de750..f17de750 100644 --- a/apps/com.pelagicore.qtlocation/assets/pin-your-position.png +++ b/apps/com.pelagicore.map/assets/pin-your-position.png diff --git a/apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml b/apps/com.pelagicore.map/controls/MapSearchTextField.qml index 275294a3..275294a3 100644 --- a/apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml +++ b/apps/com.pelagicore.map/controls/MapSearchTextField.qml diff --git a/apps/com.pelagicore.qtlocation/controls/MapToolButton.qml b/apps/com.pelagicore.map/controls/MapToolButton.qml index 9cbb47c4..9cbb47c4 100644 --- a/apps/com.pelagicore.qtlocation/controls/MapToolButton.qml +++ b/apps/com.pelagicore.map/controls/MapToolButton.qml diff --git a/apps/com.pelagicore.qtlocation/helpers/Helper.qml b/apps/com.pelagicore.map/helpers/Helper.qml index 5c94d7be..5c94d7be 100644 --- a/apps/com.pelagicore.qtlocation/helpers/Helper.qml +++ b/apps/com.pelagicore.map/helpers/Helper.qml diff --git a/apps/com.pelagicore.qtlocation/helpers/StandAlone.qml b/apps/com.pelagicore.map/helpers/StandAlone.qml index 0d24a79e..0d24a79e 100644 --- a/apps/com.pelagicore.qtlocation/helpers/StandAlone.qml +++ b/apps/com.pelagicore.map/helpers/StandAlone.qml diff --git a/apps/com.pelagicore.qtlocation/helpers/run-standalone.sh b/apps/com.pelagicore.map/helpers/run-standalone.sh index 236674bc..236674bc 100755 --- a/apps/com.pelagicore.qtlocation/helpers/run-standalone.sh +++ b/apps/com.pelagicore.map/helpers/run-standalone.sh diff --git a/apps/com.pelagicore.qtlocation/icon.png b/apps/com.pelagicore.map/icon.png index 807797da..807797da 100644 --- a/apps/com.pelagicore.qtlocation/icon.png +++ b/apps/com.pelagicore.map/icon.png diff --git a/apps/com.pelagicore.qtlocation/info.yaml b/apps/com.pelagicore.map/info.yaml index d3d47c94..5e42e8b5 100644 --- a/apps/com.pelagicore.qtlocation/info.yaml +++ b/apps/com.pelagicore.map/info.yaml @@ -1,7 +1,7 @@ formatVersion: 1 formatType: am-application --- -id: 'com.pelagicore.qtlocation' +id: 'com.pelagicore.map' icon: 'icon.png' code: 'Main.qml' runtime: 'qml' diff --git a/apps/com.pelagicore.qtlocation/maps/mapboxgl.db b/apps/com.pelagicore.map/maps/mapboxgl.db index fc84344d..fc84344d 100644 --- a/apps/com.pelagicore.qtlocation/maps/mapboxgl.db +++ b/apps/com.pelagicore.map/maps/mapboxgl.db diff --git a/apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml b/apps/com.pelagicore.map/panels/FavDestinationButtonsPanel.qml index f1c89a25..f1c89a25 100644 --- a/apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml +++ b/apps/com.pelagicore.map/panels/FavDestinationButtonsPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml b/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml index 4138c501..4138c501 100644 --- a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml +++ b/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml b/apps/com.pelagicore.map/panels/HeaderBackgroundWidgetPanel.qml index 7eb004d2..7eb004d2 100644 --- a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml +++ b/apps/com.pelagicore.map/panels/HeaderBackgroundWidgetPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml b/apps/com.pelagicore.map/panels/MapBoxPanel.qml index 83fcab26..83fcab26 100644 --- a/apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml +++ b/apps/com.pelagicore.map/panels/MapBoxPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml b/apps/com.pelagicore.map/panels/MapHeaderPanel.qml index 5444499f..5444499f 100644 --- a/apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml +++ b/apps/com.pelagicore.map/panels/MapHeaderPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml b/apps/com.pelagicore.map/panels/NavigationConfirmPanel.qml index 1ae271f1..1ae271f1 100644 --- a/apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml +++ b/apps/com.pelagicore.map/panels/NavigationConfirmPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml b/apps/com.pelagicore.map/panels/NavigationSearchPanel.qml index 6fe3bde9..6fe3bde9 100644 --- a/apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml +++ b/apps/com.pelagicore.map/panels/NavigationSearchPanel.qml diff --git a/apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml b/apps/com.pelagicore.map/panels/SearchOverlayPanel.qml index c4823ec3..c4823ec3 100644 --- a/apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml +++ b/apps/com.pelagicore.map/panels/SearchOverlayPanel.qml diff --git a/apps/com.pelagicore.qtlocation/stores/MapStore.qml b/apps/com.pelagicore.map/stores/MapStore.qml index 90cee085..0864674c 100644 --- a/apps/com.pelagicore.qtlocation/stores/MapStore.qml +++ b/apps/com.pelagicore.map/stores/MapStore.qml @@ -32,6 +32,8 @@ import QtQuick 2.8 import QtPositioning 5.9 import QtLocation 5.9 +import Qt.labs.platform 1.0 +import utils 1.0 QtObject { id: root @@ -43,6 +45,14 @@ QtObject { property var routeSegments property string homeRouteTime property string workRouteTime + property bool searchViewEnabled: false + property bool offlineMapsEnabled: false + + property var positionCoordinate: root.offlineMapsEnabled ? QtPositioning.coordinate(57.709912, 11.966632) // Gothenburg + : QtPositioning.coordinate(49.5938686, 17.2508706) // Olomouc + property var originalPosition: positionCoordinate + readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" + readonly property string defaultDarkThemeId: "mapbox://styles/qtauto/cjcm1czb812co2sno1ypmp1r8" property alias routingPlugin: routeModel.plugin property var currentLocationCoord @@ -54,6 +64,50 @@ QtObject { property string destination + function fetchCurrentLocation() { // PositionSource doesn't work on Linux + var req = new XMLHttpRequest; + req.onreadystatechange = function() { + if (req.readyState === XMLHttpRequest.DONE) { + var objectArray = JSON.parse(req.responseText); + if (objectArray.errors !== undefined) { + console.warn("Error fetching location:", objectArray.errors[0].message); + } else { + root.positionCoordinate = QtPositioning.coordinate(objectArray.location.lat, objectArray.location.lng); + console.info("Current location:", root.positionCoordinate); + } + } + } + req.open("GET", "https://location.services.mozilla.com/v1/geolocate?key=geoclue"); + req.send(); + } + + function getAvailableMapsAndLocation(mapReady, supportedMapTypes) { + if (mapReady) { + mapTypeModel.clear(); + console.info("Supported map types:"); + for (var i = 0; i < supportedMapTypes.length; i++) { + var map = supportedMapTypes[i]; + mapTypeModel.append({"name": map.name, "data": map}) // fill the map type model + console.info("\t", map.name, ", description:", map.description, ", style:", map.style, ", night mode:", map.night); + } + if (!root.offlineMapsEnabled) { + fetchCurrentLocation(); + } + } + } + + function getMapType(mapBoxPanelReady, name) { + if (!mapBoxPanelReady || !mapTypeModel.count) { + return + } + for (var i = 0; i < mapTypeModel.count; i++) { + var map = mapTypeModel.get(i); + if (map && map.name === name) { + return map.data; + } + } + } + function formatMeters(meters) { return qsTr("%n kilometer(s)", "", meters/1000) } @@ -74,6 +128,45 @@ QtObject { return result; } + // lists the various map styles (including the custom ones); filled in Map.onMapReadyChanged + readonly property ListModel mapTypeModel: ListModel { } + + readonly property Plugin mapPlugin: Plugin { + name: "mapboxgl" + locales: Style.languageLocale + + readonly property string cacheDirUrl: StandardPaths.writableLocation(StandardPaths.CacheLocation); + + // Mapbox Plugin Parameters + PluginParameter { + name: "mapboxgl.access_token" + value: "pk.eyJ1IjoicXRhdXRvIiwiYSI6ImNqY20wbDZidzBvcTQyd3J3NDlkZ21jdjUifQ.4KYDlP7UmQEVPYffr6VuVQ" + } + PluginParameter { + name: "mapboxgl.mapping.additional_style_urls" + value: [root.defaultLightThemeId, root.defaultDarkThemeId].join(",") + } + + // Offline maps support + PluginParameter { name: "mapboxgl.mapping.cache.directory"; + // needs to be an absolute filepath so strip the file:/// protocol; several leading slashes don't matter + value: mapPlugin.cacheDirUrl.toString().substring(mapPlugin.cacheDirUrl.indexOf(':')+1) } + } + + // This is needed since MapBox plugin does not support geocoding yet. TODO: find a better way to support geocoding. + readonly property Plugin geocodePlugin: Plugin { + name: "osm" + locales: Style.languageLocale + + // OSM Plugin Parameters + PluginParameter { name: "osm.useragent"; value: "Neptune UI" } + } + + readonly property GeocodeModel geocodeModel: GeocodeModel { + plugin: root.geocodePlugin + limit: 20 + } + readonly property RouteModel routeModel: RouteModel { id: routeModel autoUpdate: !!root.startCoord && !!root.destCoord diff --git a/apps/com.pelagicore.map/views/MapView.qml b/apps/com.pelagicore.map/views/MapView.qml new file mode 100644 index 00000000..1b6675bd --- /dev/null +++ b/apps/com.pelagicore.map/views/MapView.qml @@ -0,0 +1,196 @@ +/**************************************************************************** +** +** Copyright (C) 2017-2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtPositioning 5.9 +import QtLocation 5.9 +import QtGraphicalEffects 1.0 + +import Qt.labs.platform 1.0 + +import utils 1.0 +import controls 1.0 as NeptuneControls +import animations 1.0 + +import com.pelagicore.styles.neptune 3.0 + +import "../controls" +import "../panels" +import "../stores" +import "../helpers" + +Item { + id: root + + property MapStore store + property Helper helper: Helper {} + + // props for secondary window + property alias mapInteractive: mapBoxPanel.mapInteractive + property alias mapCenter: mapBoxPanel.center + property alias mapZoomLevel: mapBoxPanel.zoomLevel + property alias mapTilt: mapBoxPanel.tilt + property alias mapBearing: mapBoxPanel.bearing + readonly property alias mapReady: mapBoxPanel.mapReady + + signal maximizeMap() + + Component.onCompleted: { + root.store.homeCoord = mapBoxPanel.mapHeader.homeAddressData; + root.store.workCoord = mapBoxPanel.mapHeader.workAddressData; + } + + onStateChanged: root.store.searchViewEnabled = false; + + MapBoxPanel { + id: mapBoxPanel + anchors.fill: parent + plugin: root.store.mapPlugin + center: root.store.positionCoordinate + state: root.state + currentLocation: root.store.positionCoordinate + offlineMapsEnabled: root.store.offlineMapsEnabled + destination: root.store.destination + model: root.store.model + routeDistance: root.store.routeDistance + routeTime: root.store.routeTime + routeSegments: root.store.routeSegments + homeRouteTime: root.store.homeRouteTime + workRouteTime: root.store.workRouteTime + destCoord: root.store.destCoord + + activeMapType: { + if (!mapReady || plugin.name !== "mapboxgl") { + return supportedMapTypes[0]; + } + return NeptuneStyle.theme === NeptuneStyle.Light ? root.store.getMapType(mapBoxPanel.mapReady, root.store.defaultLightThemeId) + : root.store.getMapType(mapBoxPanel.mapReady, root.store.defaultDarkThemeId); + } + onOpenSearchTextInput: { + root.maximizeMap(); + root.store.searchViewEnabled = true; + } + onStartNavigationRequested: { + root.store.originalPosition = root.store.positionCoordinate; + } + onShowRouteRequested: { + root.store.originalPosition = root.store.positionCoordinate; + root.store.destCoord = destCoord; + root.store.destination = description; + root.store.startCoord = mapBoxPanel.currentLocation; + } + onStopNavigationRequested: { + root.store.positionCoordinate = root.store.originalPosition; + mapBoxPanel.center = root.store.positionCoordinate; + } + + onMapReadyChanged: root.store.getAvailableMapsAndLocation(mapBoxPanel.mapReady, mapBoxPanel.supportedMapTypes); + onMaximizeMap: root.maximizeMap(); + Component.onCompleted: { + root.store.routingPlugin = root.store.geocodePlugin + } + } + + NeptuneControls.Tool { + anchors.left: parent.left + anchors.leftMargin: NeptuneStyle.dp(27) + anchors.top: parent.top + anchors.topMargin: NeptuneStyle.dp(48) + opacity: root.state === "Widget1Row" ? 1 : 0 + Behavior on opacity { DefaultNumberAnimation {} } + visible: opacity > 0 + symbol: Qt.resolvedUrl("../assets/ic-search.png") + width: NeptuneStyle.dp(background.sourceSize.width) + height: width + background: Image { + fillMode: Image.PreserveAspectFit + source: helper.localAsset("floating-button-bg", NeptuneStyle.theme) + } + onClicked: root.maximizeMap() + } + + FastBlur { + anchors.fill: mapBoxPanel + source: mapBoxPanel + radius: NeptuneStyle.dp(64) + visible: root.store.searchViewEnabled + } + + NeptuneControls.ScalableBorderImage { + id: overlay + anchors.fill: root + border.top: NeptuneStyle.dp(322) + border.bottom: NeptuneStyle.dp(323) + border.left: 0 + border.right: 0 + source: Style.gfx2("input-overlay") + visible: root.store.searchViewEnabled + } + + SearchOverlayPanel { + id: searchOverlay + anchors.fill: root + anchors.topMargin: NeptuneStyle.dp(80) + visible: root.store.searchViewEnabled + spacing: NeptuneStyle.dp(80) + model: root.store.geocodeModel + + onBackButtonClicked: root.store.searchViewEnabled = false + + onSearchFieldAccepted: { + root.store.geocodeModel.query = searchOverlay.searchQuery; + root.store.geocodeModel.update(); + root.store.searchViewEnabled = false; + } + + onSearchQueryChanged: { + root.store.geocodeModel.reset(); + root.store.geocodeModel.query = searchQuery; + root.store.geocodeModel.update(); + } + + onEscapePressed: root.store.searchViewEnabled = false + + onItemClicked: { + root.store.searchViewEnabled = false; + mapBoxPanel.center = coordinate; + root.store.startCoord = root.store.positionCoordinate; + root.store.destCoord = coordinate; + root.store.destination = addressText; + if (boundingBox.isValid) { + mapBoxPanel.visibleRegion = boundingBox; + } + mapBoxPanel.navigationMode = true; + } + } +} diff --git a/apps/com.pelagicore.qtlocation/views/MapView.qml b/apps/com.pelagicore.qtlocation/views/MapView.qml deleted file mode 100644 index 68d866f0..00000000 --- a/apps/com.pelagicore.qtlocation/views/MapView.qml +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017-2018 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 -import QtPositioning 5.9 -import QtLocation 5.9 -import QtGraphicalEffects 1.0 - -import Qt.labs.platform 1.0 - -import utils 1.0 -import controls 1.0 as NeptuneControls -import animations 1.0 - -import com.pelagicore.styles.neptune 3.0 - -import "../controls" -import "../panels" -import "../stores" -import "../helpers" - -Item { - id: root - - property bool offlineMapsEnabled - onOfflineMapsEnabledChanged: getAvailableMapsAndLocation() - - property MapStore store - - // props for secondary window - property alias mapInteractive: mapBoxView.mapInteractive - property alias mapCenter: mapBoxView.center - property alias mapZoomLevel: mapBoxView.zoomLevel - property alias mapTilt: mapBoxView.tilt - property alias mapBearing: mapBoxView.bearing - readonly property alias mapReady: mapBoxView.mapReady - readonly property alias currentLocation: priv.positionCoordinate - - property bool searchViewEnabled: false - property Helper helper: Helper {} - - signal maximizeMap() - - Component.onCompleted: { - root.store.homeCoord = mapBoxView.mapHeader.homeAddressData; - root.store.workCoord = mapBoxView.mapHeader.workAddressData; - } - - onStateChanged: root.searchViewEnabled = false; - - function fetchCurrentLocation() { // PositionSource doesn't work on Linux - var req = new XMLHttpRequest; - req.onreadystatechange = function() { - if (req.readyState === XMLHttpRequest.DONE) { - var objectArray = JSON.parse(req.responseText); - if (objectArray.errors !== undefined) { - console.warn("Error fetching location:", objectArray.errors[0].message); - } else { - priv.positionCoordinate = QtPositioning.coordinate(objectArray.location.lat, objectArray.location.lng); - console.info("Current location:", priv.positionCoordinate); - } - } - } - req.open("GET", "https://location.services.mozilla.com/v1/geolocate?key=geoclue"); - req.send(); - } - - function getAvailableMapsAndLocation() { - if (mapBoxView.mapReady) { - mapTypeModel.clear(); - console.info("Supported map types:"); - for (var i = 0; i < mapBoxView.supportedMapTypes.length; i++) { - var map = mapBoxView.supportedMapTypes[i]; - mapTypeModel.append({"name": map.name, "data": map}) // fill the map type model - console.info("\t", map.name, ", description:", map.description, ", style:", map.style, ", night mode:", map.night); - } - if (!root.offlineMapsEnabled) { - fetchCurrentLocation(); - } - } - } - - function getMapType(name) { - if (!mapBoxView.mapReady || !mapTypeModel.count) { - return - } - for (var i = 0; i < mapTypeModel.count; i++) { - var map = mapTypeModel.get(i); - if (map && map.name === name) { - return map.data; - } - } - } - - QtObject { - id: priv - readonly property var plugins: ["mapboxgl", "osm"] - property var positionCoordinate: offlineMapsEnabled ? QtPositioning.coordinate(57.709912, 11.966632) // Gothenburg - : QtPositioning.coordinate(49.5938686, 17.2508706) // Olomouc - property var originalPosition: positionCoordinate - readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" - readonly property string defaultDarkThemeId: "mapbox://styles/qtauto/cjcm1czb812co2sno1ypmp1r8" - } - - ListModel { - // lists the various map styles (including the custom ones); filled in Map.onMapReadyChanged - id: mapTypeModel - } - - Plugin { - id: mapPlugin - locales: Style.languageLocale - preferred: priv.plugins - - readonly property string cacheDirUrl: StandardPaths.writableLocation(StandardPaths.CacheLocation); - - // Mapbox Plugin Parameters - PluginParameter { - name: "mapboxgl.access_token" - value: "pk.eyJ1IjoicXRhdXRvIiwiYSI6ImNqY20wbDZidzBvcTQyd3J3NDlkZ21jdjUifQ.4KYDlP7UmQEVPYffr6VuVQ" - } - PluginParameter { - name: "mapboxgl.mapping.additional_style_urls" - value: [priv.defaultLightThemeId, priv.defaultDarkThemeId].join(",") - } - - // OSM Plugin Parameters - PluginParameter { name: "osm.useragent"; value: "Neptune UI" } - - // Offline maps support - PluginParameter { name: "mapboxgl.mapping.cache.directory"; - // needs to be an absolute filepath so strip the file:/// protocol; several leading slashes don't matter - value: mapPlugin.cacheDirUrl.toString().substring(mapPlugin.cacheDirUrl.indexOf(':')+1) } - } - - // This is needed since MapBox plugin does not support geocoding yet. TODO: find a better way to support geocoding. - Plugin { - id: geocodePlugin - name: "osm" - locales: Style.languageLocale - - // OSM Plugin Parameters - PluginParameter { name: "osm.useragent"; value: "Neptune UI" } - } - - GeocodeModel { - id: geocodeModel - plugin: geocodePlugin - limit: 20 - } - - MapBoxPanel { - id: mapBoxView - anchors.fill: parent - plugin: mapPlugin - center: priv.positionCoordinate - state: root.state - currentLocation: priv.positionCoordinate - offlineMapsEnabled: root.offlineMapsEnabled - destination: root.store.destination - model: root.store.model - routeDistance: root.store.routeDistance - routeTime: root.store.routeTime - routeSegments: root.store.routeSegments - homeRouteTime: root.store.homeRouteTime - workRouteTime: root.store.workRouteTime - destCoord: root.store.destCoord - - activeMapType: { - if (!mapReady || plugin.name !== "mapboxgl") { - return supportedMapTypes[0]; - } - return NeptuneStyle.theme === NeptuneStyle.Light ? getMapType(priv.defaultLightThemeId) : getMapType(priv.defaultDarkThemeId); - } - onOpenSearchTextInput: { - root.maximizeMap(); - searchViewEnabled = true; - } - onStartNavigationRequested: { - priv.originalPosition = priv.positionCoordinate; - } - onShowRouteRequested: { - priv.originalPosition = priv.positionCoordinate; - root.store.destCoord = destCoord; - root.store.destination = description; - root.store.startCoord = mapBoxView.currentLocation; - } - onStopNavigationRequested: { - priv.positionCoordinate = priv.originalPosition; - mapBoxView.center = priv.positionCoordinate; - } - - onMapReadyChanged: getAvailableMapsAndLocation(); - onMaximizeMap: root.maximizeMap(); - Component.onCompleted: { - root.store.routingPlugin = geocodePlugin - } - } - - NeptuneControls.Tool { - anchors.left: parent.left - anchors.leftMargin: NeptuneStyle.dp(27) - anchors.top: parent.top - anchors.topMargin: NeptuneStyle.dp(48) - opacity: root.state === "Widget1Row" ? 1 : 0 - Behavior on opacity { DefaultNumberAnimation {} } - visible: opacity > 0 - symbol: Qt.resolvedUrl("../assets/ic-search.png") - width: NeptuneStyle.dp(background.sourceSize.width) - height: width - background: Image { - fillMode: Image.PreserveAspectFit - source: helper.localAsset("floating-button-bg", NeptuneStyle.theme) - } - onClicked: root.maximizeMap() - } - - FastBlur { - anchors.fill: mapBoxView - source: mapBoxView - radius: NeptuneStyle.dp(64) - visible: searchViewEnabled - } - - NeptuneControls.ScalableBorderImage { - id: overlay - anchors.fill: root - border.top: NeptuneStyle.dp(322) - border.bottom: NeptuneStyle.dp(323) - border.left: 0 - border.right: 0 - source: Style.gfx2("input-overlay") - visible: searchViewEnabled - } - - SearchOverlayPanel { - id: searchOverlay - anchors.fill: root - anchors.topMargin: NeptuneStyle.dp(80) - visible: searchViewEnabled - spacing: NeptuneStyle.dp(80) - model: geocodeModel - - onBackButtonClicked: searchViewEnabled = false - - onSearchFieldAccepted: { - geocodeModel.query = searchOverlay.searchQuery; - geocodeModel.update(); - searchViewEnabled = false; - } - - onSearchQueryChanged: { - geocodeModel.reset(); - geocodeModel.query = searchQuery; - geocodeModel.update(); - } - - onEscapePressed: searchViewEnabled = false - - onItemClicked: { - searchViewEnabled = false; - mapBoxView.center = coordinate; - root.store.startCoord = priv.positionCoordinate; - root.store.destCoord = coordinate; - root.store.destination = addressText; - if (boundingBox.isValid) { - mapBoxView.visibleRegion = boundingBox; - } - mapBoxView.navigationMode = true; - } - } -} diff --git a/plugins/com.pelagicore.qtlocation/com.pelagicore.qtlocation.pro b/plugins/com.pelagicore.map/com.pelagicore.map.pro index 77b8ce8c..40b55485 100644 --- a/plugins/com.pelagicore.qtlocation/com.pelagicore.qtlocation.pro +++ b/plugins/com.pelagicore.map/com.pelagicore.map.pro @@ -3,7 +3,7 @@ TARGET = mapshelperplugin QT += quick CONFIG += qt plugin c++11 -uri = com.pelagicore.qtlocation +uri = com.pelagicore.map load(qmlplugin) SOURCES += \ diff --git a/plugins/com.pelagicore.qtlocation/mapshelper.cpp b/plugins/com.pelagicore.map/mapshelper.cpp index 4dffe139..3b2584f5 100644 --- a/plugins/com.pelagicore.qtlocation/mapshelper.cpp +++ b/plugins/com.pelagicore.map/mapshelper.cpp @@ -46,7 +46,7 @@ MapsHelper::MapsHelper(QObject *parent) void MapsHelper::classBegin() { // copy mapboxgl offline DB - const QString prefix = STR(INSTALL_PATH) + QStringLiteral("apps/com.pelagicore.qtlocation/"); + const QString prefix = STR(INSTALL_PATH) + QStringLiteral("apps/com.pelagicore.map/"); const QString sourceFile = prefix + QStringLiteral("maps/mapboxgl.db"); const QString destDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); const QString destFile = destDir + QStringLiteral("/mapboxgl.db"); diff --git a/plugins/com.pelagicore.qtlocation/mapshelper.h b/plugins/com.pelagicore.map/mapshelper.h index 7c80759d..7c80759d 100644 --- a/plugins/com.pelagicore.qtlocation/mapshelper.h +++ b/plugins/com.pelagicore.map/mapshelper.h diff --git a/plugins/com.pelagicore.qtlocation/plugin.cpp b/plugins/com.pelagicore.map/plugin.cpp index e1e837dc..1a4ccd38 100644 --- a/plugins/com.pelagicore.qtlocation/plugin.cpp +++ b/plugins/com.pelagicore.map/plugin.cpp @@ -41,7 +41,7 @@ class MapsHelperPlugin : public QQmlExtensionPlugin public: void registerTypes(const char *uri) override { - Q_ASSERT(QLatin1String(uri) == QLatin1String("com.pelagicore.qtlocation")); + Q_ASSERT(QLatin1String(uri) == QLatin1String("com.pelagicore.map")); qmlRegisterType<MapsHelper>(uri, 1, 0, "MapsHelper"); } diff --git a/plugins/com.pelagicore.map/qmldir b/plugins/com.pelagicore.map/qmldir new file mode 100644 index 00000000..b3c7713d --- /dev/null +++ b/plugins/com.pelagicore.map/qmldir @@ -0,0 +1,2 @@ +module com.pelagicore.map +plugin mapshelperplugin diff --git a/plugins/com.pelagicore.qtlocation/qmldir b/plugins/com.pelagicore.qtlocation/qmldir deleted file mode 100644 index 1d5b9833..00000000 --- a/plugins/com.pelagicore.qtlocation/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -module com.pelagicore.qtlocation -plugin mapshelperplugin diff --git a/plugins/plugins.pro b/plugins/plugins.pro index 79ca8c88..92128f2b 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -6,4 +6,4 @@ SUBDIRS = \ translation \ widgetgrid \ systeminfo \ - com.pelagicore.qtlocation + com.pelagicore.map |