diff --git a/ExportView.qml b/ExportView.qml index ab2da98..c72df1c 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -85,7 +85,16 @@ Item { mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.historyButtonEnabled = true; mainView.appToolBar.settingsButtonEnabled = false; - mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage + mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage; + } + + StackView.onActivated: { + mapViewPlus.mapTileService = currentTileService.url; + mapViewPlus.mapTileServiceUsesToken = currentTileService.useTokenToAccess; + } + + StackView.onDeactivating: { + mapViewPlus.mapClearData(); } //-------------------------------------------------------------------------- @@ -140,7 +149,7 @@ Item { // MAP SECTION ///////////////////////////////////////////////// Rectangle { - color: "#fff" + color:"#fff" Layout.fillWidth: true Layout.fillHeight: true @@ -155,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)); @@ -190,6 +198,9 @@ Item { } onDrawingStarted: { + if (!map.mapReady){ + return; + } } onDrawingFinished: { @@ -230,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 //////////////////////////////////////// @@ -442,6 +469,8 @@ Item { onChangeTileService: { exportView.currentTileIndex = index; exportView.currentTileService = availableServices.get(index); + mapViewPlus.mapTileService = exportView.currentTileService.url; + mapViewPlus.mapTileServiceUsesToken = exportView.currentTileService.useTokenToAccess; } onExportZoomLevelsChanged: { 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/MapView.qml b/MapViewPlus/MapView.qml index c46e71b..88a0e75 100644 --- a/MapViewPlus/MapView.qml +++ b/MapViewPlus/MapView.qml @@ -82,12 +82,6 @@ Item { name: "ArcGIS.mapping.mapTypes.mapSources" value: internal.mapSources } - -// PluginParameter { -// id: pluginMaxZoomLevel -// name: "ArcGIS.mapping.maximumZoomLevel" -// value: exportDetails.maxLevels -// } } center: QtPositioning.coordinate(defaultCenter.lat,defaultCenter.long) @@ -103,14 +97,12 @@ Item { } gesture.onFlickStarted: { - console.log('flick started'); } + gesture.onPinchStarted: { - console.log('pinch started'); } Component.onCompleted: { - clearData(); } onZoomLevelChanged: { diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 06cd8a2..d25d91e 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -1218,7 +1218,7 @@ Item { anchors.fill: parent defaultCenter: mapDefaultCenter defaultZoomLevel: mapDefaultZoomLevel - mapService: mapTileService + mapService: mapTileService !== null ? mapTileService : "" useToken: mapTileServiceUsesToken z: 50000 focus: !drawing @@ -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 ///////////////////////////////////////////////////////////////////// }