diff --git a/ExportView.qml b/ExportView.qml index b7885a4..c72df1c 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -94,7 +94,7 @@ Item { } StackView.onDeactivating: { - mapViewPlus.map.clearData(); + mapViewPlus.mapClearData(); } //-------------------------------------------------------------------------- @@ -149,7 +149,7 @@ Item { // MAP SECTION ///////////////////////////////////////////////// Rectangle { - color: "#fff" + color:"#fff" Layout.fillWidth: true Layout.fillHeight: true @@ -164,14 +164,13 @@ Item { Layout.fillHeight: true Layout.fillWidth: true clip: true + enabled: map !== null && map.mapReady mapViewPlusPortal: exportView.portal mapDefaultLat: app.info.properties.mapDefaultLat mapDefaultLong: app.info.properties.mapDefaultLong mapDefaultZoomLevel: (calledFromAnotherApp && dlr.zoomLevel !== null) ? dlr.zoomLevel : app.info.properties.mapDefaultZoomLevel mapDefaultCenter: (calledFromAnotherApp && dlr.center !== null) ? dlr.center : {"lat": app.info.properties.mapDefaultLat, "long": app.info.properties.mapDefaultLong } -// mapTileService: currentTileService.url -// mapTileServiceUsesToken: currentTileService.useTokenToAccess Component.onCompleted: { zoomLevelIndicator.text = "%1".arg(parseFloat(mapViewPlus.map.zoomLevel).toFixed(1)); @@ -199,6 +198,9 @@ Item { } onDrawingStarted: { + if (!map.mapReady){ + return; + } } onDrawingFinished: { @@ -239,6 +241,22 @@ Item { } } } + + Rectangle { + anchors.fill: parent + color: "#333" + visible: mapViewPlus.map === null || !mapViewPlus.map.mapReady + Text { + anchors.fill: parent + anchors.margins: sf(20) + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.Wrap + text: qsTr("Error Loading Map Service: %1".arg(currentTileService.url)) + font.pointSize: 18 + color: "#fff" + } + } } // MAP TOOL BAR //////////////////////////////////////// @@ -449,9 +467,6 @@ Item { tpkTitle: exportView.extractDefaultTPKTitle(exportView.currentTileService.title) onChangeTileService: { -// if (mapViewPlus.map !== null) { -// mapViewPlus.map.clearData(); -// } exportView.currentTileIndex = index; exportView.currentTileService = availableServices.get(index); mapViewPlus.mapTileService = exportView.currentTileService.url; diff --git a/HistoryView.qml b/HistoryView.qml index 91e47c3..3c7da6d 100644 --- a/HistoryView.qml +++ b/HistoryView.qml @@ -34,16 +34,9 @@ Item { property bool exportHistoryExists: false property bool uploadHistoryExists: false -// property var xHistory -// property var uHistory - - // SIGNAL IMPLEMENTATIONS ////////////////////////////////////////////////// Component.onCompleted: { -// xHistory = appDatabase.read("SELECT * FROM 'exports' ORDER BY OBJECTID DESC"); - getExportHistory(); - getUploadHistory(); } //-------------------------------------------------------------------------- @@ -56,6 +49,10 @@ Item { mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.exportAndUploadHistory; } + StackView.onActivated: { + getExportHistory(); + getUploadHistory(); + } // UI ////////////////////////////////////////////////////////////////////// @@ -145,32 +142,6 @@ Item { Layout.fillHeight: true Layout.fillWidth: true -// ListView { -// id: exportListView -// width: parent.width -// height: parent.height -// clip: true -// flickableDirection: Flickable.VerticalFlick -// model: xHistory -// spacing: sf(5) -// delegate: Rectangle { -// width: parent.width -// height: childrenRect.height -// color: "gold" -// Column{ -// anchors.fill: parent -// Text { -// width: parent.width -// text: title -// } -// Text { -// width: parent.width -// text: new Date(transaction_date).toLocaleDateString() + " " + new Date(transaction_date).toLocaleTimeString() -// } -// } -// } -// } - Flickable { id: exportFlickable anchors.fill: parent diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 8c9574f..d25d91e 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -2117,5 +2117,13 @@ Item { userBookmarks = appDatabase.read("SELECT * FROM 'bookmarks' WHERE user IS '%1'".arg(portal.user.email)); } + //-------------------------------------------------------------------------- + + function mapClearData(){ + if (map.mapReady && map !== null) { + map.clearData(); + } + } + // END ///////////////////////////////////////////////////////////////////// }