From 16b6a17c2ffb5959b31293972e1475a5040e1964 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 18 Oct 2017 13:52:56 +1100 Subject: [PATCH 01/29] Updated version number to 1.3 --- appinfo.json | 4 ++-- iteminfo.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appinfo.json b/appinfo.json index 2ddfefa..819406f 100644 --- a/appinfo.json +++ b/appinfo.json @@ -96,7 +96,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 23, - "minor": 2 + "micro": 1, + "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index da142f7..1b8b7e5 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1508218106000, + "modified": 1508277493000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 38, + "numComments": 39, "numRatings": 0, - "numViews": 156, + "numViews": 159, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -36,7 +36,7 @@ "proxyFilter": null, "screenshots": [ ], - "size": 849343, + "size": 849340, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From bd05947c8e8df6ebd5ed426a8767863c2026a652 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Mon, 26 Mar 2018 16:37:30 +1100 Subject: [PATCH 02/29] #4 #56 #59 Added Settings page, Max levels set to 21 with option to go higher, Updated request timeout --- AppToolBar.qml | 80 +++++++++++---- AvailableServicesInfoRequest.qml | 20 +++- AvailableServicesModel.qml | 25 ++++- AvailableServicesView.qml | 100 ++++++++++-------- BrowseOrgView.qml | 1 + Controls/StyledCheckBox.qml | 131 +++++++++++++++++------- Controls/StyledSlider.qml | 53 ++++++++++ Controls/StyledTextField.qml | 6 +- DetailsForm.qml | 2 +- ExportView.qml | 9 +- HistoryView.qml | 1 + MainView.qml | 8 ++ MapViewPlus/MapView.qml | 8 ++ MapViewPlus/MapViewPlus.qml | 1 + OperationSelectionView.qml | 1 + SettingsView.qml | 167 +++++++++++++++++++++++++++++++ TilePackageKreator.qml | 23 +++++ UploadView.qml | 1 + appinfo.json | 5 + fonts/tilepackage.svg | 43 ++++++++ fonts/tilepackage.ttf | Bin 7128 -> 7940 bytes fonts/tilepackagekreator.ttf | Bin 8532 -> 0 bytes fonts/tpk.ttf | Bin 8352 -> 0 bytes images/settings.svg | 5 + iteminfo.json | 4 +- singletons/Config.qml | 1 + singletons/Constants.qml | 4 + singletons/Strings.qml | 9 +- 28 files changed, 592 insertions(+), 116 deletions(-) create mode 100644 Controls/StyledSlider.qml create mode 100644 SettingsView.qml create mode 100644 fonts/tilepackage.svg delete mode 100644 fonts/tilepackagekreator.ttf delete mode 100755 fonts/tpk.ttf create mode 100755 images/settings.svg diff --git a/AppToolBar.qml b/AppToolBar.qml index 7a42cce..b5bb13c 100644 --- a/AppToolBar.qml +++ b/AppToolBar.qml @@ -69,6 +69,8 @@ Item { property alias aboutButtonEnabled: aboutButton.enabled property alias userButtonVisible: userButton.visible property alias userButtonEnabled: userButton.enabled + property alias settingsButtonVisible: settingsButton.visible + property alias settingsButtonEnabled: settingsButton.enabled // UI ////////////////////////////////////////////////////////////////////// @@ -84,7 +86,7 @@ Item { //------------------------------------------------------------------ Button{ - id:backButton + id: backButton Layout.preferredWidth: toolBarHeight Layout.fillHeight: true @@ -112,7 +114,7 @@ Item { Accessible.name: Singletons.Strings.goBackToPreviousView Accessible.description: Singletons.Strings.goBackToPreviousViewDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -165,7 +167,7 @@ Item { Accessible.ignored: true } - Rectangle{ + Rectangle { id: numberOfUpdatesIndicator visible: false color: "orange" @@ -176,7 +178,7 @@ Item { anchors.right: updatesButton.right anchors.topMargin: 4 * AppFramework.displayScaleFactor anchors.rightMargin: 4 * AppFramework.displayScaleFactor - Text{ + Text { id: numberOfUpdatesIndicatorCount anchors.centerIn: parent text: "0" @@ -193,7 +195,7 @@ Item { Accessible.name: Singletons.Strings.xUpdatesAvaliable.arg(numberOfUpdatesIndicatorCount.text) Accessible.description: Singletons.Strings.xUpdatesAvaliableDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -201,7 +203,7 @@ Item { //------------------------------------------------------------------ - Button{ + Button { id: feedbackButton Layout.preferredWidth: toolBarHeight Layout.fillHeight: true @@ -209,7 +211,7 @@ Item { ToolTip.text: Singletons.Strings.feedback enabled: true - background: Rectangle{ + background: Rectangle { color: toolBarBackground anchors.fill: parent } @@ -230,7 +232,7 @@ Item { Accessible.name: Singletons.Strings.feedback Accessible.description: Singletons.Strings.feedbackDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -266,7 +268,7 @@ Item { Accessible.name: Singletons.Strings.aboutTheApp Accessible.description: Singletons.Strings.aboutTheAppDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -274,14 +276,50 @@ Item { //------------------------------------------------------------------ - Button{ + Button { + id: settingsButton + Layout.preferredWidth: toolBarHeight + Layout.fillHeight: true + ToolTip.visible: hovered + ToolTip.text: Singletons.Strings.settings + + background: Rectangle { + color: toolBarBackground + anchors.fill: parent + } + + IconFont { + anchors.centerIn: parent + icon: _icons.settings + iconSizeMultiplier: 1.1 + color: _returnButtonColor(settingsButton) + Accessible.ignored: true + } + + onClicked: { + stackView.push(sv); + } + + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.settings + Accessible.description: Singletons.Strings.settingsDesc + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } + } + + //------------------------------------------------------------------ + + Button { id: historyButton Layout.preferredWidth: toolBarHeight Layout.fillHeight: true ToolTip.visible: hovered ToolTip.text: Singletons.Strings.history - background: Rectangle{ + background: Rectangle { color: toolBarBackground anchors.fill: parent } @@ -302,7 +340,7 @@ Item { Accessible.name: Singletons.Strings.exportAndUploadHistory Accessible.description: Singletons.Strings.exportAndUploadHistoryDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -310,7 +348,7 @@ Item { //------------------------------------------------------------------ - Button{ + Button { id: userButton Layout.preferredWidth: toolBarHeight Layout.fillHeight: true @@ -318,7 +356,7 @@ Item { ToolTip.text: (portal.user !== null && portal.user !== "" && portal.user !== undefined) ? Singletons.Strings.signOut + ": " + portal.user.fullName : "User Unknown" enabled: true - background: Rectangle{ + background: Rectangle { color: toolBarBackground anchors.fill: parent } @@ -341,7 +379,7 @@ Item { Accessible.name: Singletons.Strings.signOut Accessible.description: Singletons.Strings.signOutDesc Accessible.onPressAction: { - if(enabled && visible){ + if (enabled && visible) { clicked(); } } @@ -355,7 +393,7 @@ Item { // SIGNAL IMPLEMENTATIONS ////////////////////////////////////////////////// onUpdateCountChanged: { - if(updateCount > 0){ + if (updateCount > 0) { updatesButtonEnabled = true; updatesButtonVisible = true; updateIndicatorVisible = true; @@ -365,21 +403,21 @@ Item { // COMPONENTS ////////////////////////////////////////////////////////////// - AboutDialog{ + AboutDialog { id: aboutDialog } //-------------------------------------------------------------------------- - FeedbackDialog{ + FeedbackDialog { id: feedbackDialog metrics: mainView.appMetrics } // METHODS ///////////////////////////////////////////////////////////////// - function _returnButtonColor(cntrl){ - if(cntrl.enabled === false){ + function _returnButtonColor(cntrl) { + if (cntrl.enabled === false) { return toolBarButtonDisabledColor; } else if(cntrl.hovered){ @@ -388,7 +426,7 @@ Item { else if(cntrl.pressed){ return toolBarButtonPressedColor; } - else{ + else { return toolBarButtonColor; } } diff --git a/AvailableServicesInfoRequest.qml b/AvailableServicesInfoRequest.qml index 8c8bfee..9b52477 100644 --- a/AvailableServicesInfoRequest.qml +++ b/AvailableServicesInfoRequest.qml @@ -30,9 +30,17 @@ Item { property int tileIndex property string serviceUrl property bool useToken: true + property bool useTimeout: false + property int timeoutInterval: 30 signal complete(var data) + onComplete: { + if (timeoutTimer.running) { + timeoutTimer.stop(); + } + } + // COMPONENTS ////////////////////////////////////////////////////////////// NetworkRequest { @@ -136,7 +144,7 @@ Item { Timer { id: timeoutTimer - interval: 10000 + //interval: timeoutInterval * 1000 running: false repeat: false onTriggered: { @@ -151,11 +159,16 @@ Item { // METHODS ///////////////////////////////////////////////////////////////// - function sendRequest(){ + function sendRequest() { serviceRequest.send(); - timeoutTimer.start(); + if (useTimeout) { + timeoutTimer.interval = timeoutInterval * 1000; + timeoutTimer.start(); + } } + //-------------------------------------------------------------------------- + function _exportTilesAllowed(serviceInfo) { if (serviceInfo.hasOwnProperty("exportTilesAllowed")) { @@ -169,7 +182,6 @@ Item { else { return false; } - } // END ///////////////////////////////////////////////////////////////////// diff --git a/AvailableServicesModel.qml b/AvailableServicesModel.qml index 4606f96..07b396e 100644 --- a/AvailableServicesModel.qml +++ b/AvailableServicesModel.qml @@ -38,6 +38,8 @@ Item { property alias getAvailableServices: tileServicesSearch property string searchQuery: '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))' property SqlQueryModel userAddedServices + property bool useTimeout: app.timeoutNonResponsiveServices + property int timeoutInterval: app.timeoutValue property ListModel servicesListModel: ListModel { property var tilesToRemove: [] @@ -95,7 +97,15 @@ Item { var component = Qt.createComponent("AvailableServicesInfoRequest.qml"); if (component.status === Component.Ready) { - var thisRequest = component.createObject(parent, { portal:availableServicesModel.portal, tileIndex: tileServiceCount, serviceUrl: result.url } ); + var thisRequest = component.createObject(parent, + { + portal:availableServicesModel.portal, + tileIndex: tileServiceCount, + serviceUrl: result.url, + useTimeout: availableServicesModel.useTimeout, + timeoutInterval: availableServicesModel.timeoutInterval + } + ); thisRequest.complete.connect(function(serviceData){ if (serviceData.keep === true) { @@ -187,7 +197,15 @@ Item { var component = Qt.createComponent("AvailableServicesInfoRequest.qml"); if (component.status === Component.Ready) { - var thisRequest = component.createObject(parent, { portal:availableServicesModel.portal, tileIndex: servicesListModel.count+1 , serviceUrl: url } ); + var thisRequest = component.createObject(parent, + { + portal:availableServicesModel.portal, + tileIndex: servicesListModel.count+1, + serviceUrl: url, + useTimeout: availableServicesModel.useTimeout, + timeoutInterval: availableServicesModel.timeoutInterval + } + ); thisRequest.complete.connect(function(serviceData){ if(serviceData.keep === true){ @@ -228,7 +246,8 @@ Item { thisRequest.destroy(2000); }); - thisRequest.send(); + thisRequest.sendRequest(); + //thisRequest.send(); } } diff --git a/AvailableServicesView.qml b/AvailableServicesView.qml index d422d4d..34662a7 100644 --- a/AvailableServicesView.qml +++ b/AvailableServicesView.qml @@ -105,6 +105,7 @@ Item { mainView.appToolBar.backButtonEnabled = (!calledFromAnotherApp) ? true : false; mainView.appToolBar.backButtonVisible = (!calledFromAnotherApp) ? true : false; mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage } @@ -618,7 +619,7 @@ Item { horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.xSmallFontSizePoint font.family: notoRegular - text: spatialReference + text: spatialReference || "N/A" color: isWebMercator ? "#007ac2" : "red" elide: Text.ElideRight @@ -763,6 +764,11 @@ Item { property int menuItemHeight: sf(35) property var currentInfo: asm.servicesListModel.get(servicesGridView.currentIndex) + property bool userAddedService: (contextMenu.currentInfo !== undefined && contextMenu.currentInfo !== null) + ? contextMenu.currentInfo.userAdded !== undefined + ? (contextMenu.currentInfo.userAdded === true ? true : false) + : false + : false background: Rectangle { color: "#fff" @@ -819,8 +825,12 @@ Item { Button { height: visible ? contextMenu.menuItemHeight : 0 width: parent.width - visible: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal : false - enabled: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal : false + visible: (contextMenu.currentInfo !== undefined && contextMenu.currentInfo !== null) + ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal + : false + enabled: (contextMenu.currentInfo !== undefined && contextMenu.currentInfo !== null) + ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal + : false background: Rectangle { color: parent.hovered ? Singletons.Colors.subtleBackground : "#fff" } @@ -844,7 +854,9 @@ Item { height: sf(1) width: parent.width color: Singletons.Colors.subtleBackground - visible: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal : false + visible: (contextMenu.currentInfo !== undefined && contextMenu.currentInfo !== null) + ? contextMenu.currentInfo.isArcgisTileService || portal.isPortal + : false } Button { @@ -856,7 +868,9 @@ Item { contentItem: Text { anchors.fill: parent anchors.leftMargin: sf(10) - text: contextMenu.currentInfo !== undefined ? ( contextMenu.currentInfo.isArcgisTileService ? Singletons.Strings.viewRestService : Singletons.Strings.viewOnlineService) : "" + text: (contextMenu.currentInfo !== undefined && contextMenu.currentInfo !== null) + ? ( contextMenu.currentInfo.isArcgisTileService ? Singletons.Strings.viewRestService : Singletons.Strings.viewOnlineService) + : "" color: Singletons.Colors.boldUIElementFontColor verticalAlignment: Text.AlignVCenter } @@ -907,44 +921,44 @@ Item { Accessible.description: Singletons.Strings.createPItemDesc } -// Rectangle { -// height: sf(1) -// width: parent.width -// color: Singletons.Colors.subtleBackground -// visible: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.userAdded !== undefined ? (contextMenu.currentInfo.userAdded === true ? true : false) : false : false -// } - -// Button { -// height: contextMenu.menuItemHeight -// visible: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.userAdded !== undefined ? (contextMenu.currentInfo.userAdded === true ? true : false) : false : false -// enabled: contextMenu.currentInfo !== undefined ? contextMenu.currentInfo.userAdded !== undefined ? (contextMenu.currentInfo.userAdded === true ? true : false) : false : false -// width: parent.width -// background: Rectangle { -// color: parent.hovered ? Singletons.Colors.subtleBackground : "#fff" -// } -// contentItem: Text { -// anchors.fill: parent -// anchors.leftMargin: sf(10) -// text: qsTr("Delete tile service") -// color: Singletons.Colors.boldUIElementFontColor -// verticalAlignment: Text.AlignVCenter -// } -// onClicked: { -// try { -// var sql = "DELETE from 'other_tile_services' WHERE special_id = '%1'".arg(contextMenu.currentInfo.tpkId); -// appDatabase.write(sql); -// } -// catch(e){ -// console.log(e); -// } -// finally { -// //asm.servicesListModel.remove(servicesGridView.currentIndex); -// } -// } -// Accessible.role: Accessible.MenuItem -// Accessible.name: text -// Accessible.description: Singletons.Strings.createPItemDesc -// } + Rectangle { + height: sf(1) + width: parent.width + color: Singletons.Colors.subtleBackground + visible: contextMenu.userAddedService + } + + Button { + height: contextMenu.userAddedService ? contextMenu.menuItemHeight : 0 + visible: contextMenu.userAddedService + enabled: contextMenu.userAddedService + width: parent.width + background: Rectangle { + color: parent.hovered ? Singletons.Colors.subtleBackground : "#fff" + } + contentItem: Text { + anchors.fill: parent + anchors.leftMargin: sf(10) + text: Singletons.Strings.deleteTileService + color: Singletons.Colors.boldUIElementFontColor + verticalAlignment: Text.AlignVCenter + } + onClicked: { + try { + var sql = "DELETE from 'other_tile_services' WHERE special_id = '%1'".arg(contextMenu.currentInfo.tpkId); + appDatabase.write(sql); + asm.servicesListModel.remove(servicesGridView.currentIndex); + servicesGridView.currentIndex = -1; + contextMenu.close(); + } + catch(e){ + console.log(e); + } + } + Accessible.role: Accessible.MenuItem + Accessible.name: text + Accessible.description: Singletons.Strings.deleteTileService + } Accessible.role: Accessible.PopupMenu Accessible.name: Singletons.Strings.contextMenuDesc diff --git a/BrowseOrgView.qml b/BrowseOrgView.qml index 0f02801..1fa809a 100644 --- a/BrowseOrgView.qml +++ b/BrowseOrgView.qml @@ -58,6 +58,7 @@ Item { StackView.onActivating: { mainView.appToolBar.enabled = true; mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.backButtonEnabled = true; mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.browseOrgTilePackages diff --git a/Controls/StyledCheckBox.qml b/Controls/StyledCheckBox.qml index 3d4a7ff..dc3effa 100755 --- a/Controls/StyledCheckBox.qml +++ b/Controls/StyledCheckBox.qml @@ -1,4 +1,4 @@ -/* Copyright 2015 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,49 +14,108 @@ * */ -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick 2.9 +import QtQuick.Controls 2.2 import ArcGIS.AppFramework 1.0 +import "../" +import "../singletons" as Singletons + //------------------------------------------------------------------------------ CheckBox { + + id: control + checked: false + opacity: enabled ? 1 : .4 + + objectName: "ThemeCheckBox" + + property string label: "Checkbox" + property string tooltip: "" + property bool displayTooltip: tooltip > "" ? true : false + + ToolTip.visible: displayTooltip && hovered + ToolTip.text: tooltip + + Accessible.role: Accessible.CheckBox + Accessible.name: control.label + Accessible.description: control.label + Accessible.focusable: true + + indicator: Rectangle { + height: parent.height > sf(20) ? sf(20) : parent.height + width: height + border.color: Singletons.Colors.darkGray + color: "transparent" + anchors.verticalCenter: parent.verticalCenter + + IconFont { + anchors.centerIn: parent + icon: _icons.checkmark + iconSizeMultiplier: .6 + color: Singletons.Colors.mainButtonBackgroundColor + Accessible.ignored: true + visible: control.checked + } + } + + contentItem: Text { + text: control.label + horizontalAlignment: !Singletons.Config.rtl ? Text.AlignLeft : Text.AlignRight + verticalAlignment: Text.AlignVCenter + leftPadding: !Singletons.Config.rtl ? control.indicator.width + (6 * AppFramework.displayScaleFactor) : 0 + rightPadding: !Singletons.Config.rtl ? 0 : control.indicator.width + (6 * AppFramework.displayScaleFactor) + color: Singletons.Colors.formElementFontColor + textFormat: Text.RichText + wrapMode: Text.Wrap + font { + family: notoRegular + pointSize: Singletons.Config.baseFontSizePoint + } + onLinkActivated: { + Qt.openUrlExternally(link); + } + } + + // END ///////////////////////////////////////////////////////////////////// + + property string fontFamily - style: CheckBoxStyle { - label: Item { - implicitWidth: text.implicitWidth + 2 - implicitHeight: text.implicitHeight - baselineOffset: text.baselineOffset +// style: CheckBoxStyle { +// label: Item { +// implicitWidth: text.implicitWidth + 2 +// implicitHeight: text.implicitHeight +// baselineOffset: text.baselineOffset - Rectangle { - anchors.fill: text - anchors.margins: -1 - anchors.leftMargin: -3 - anchors.rightMargin: -3 - visible: control.activeFocus - height: 6 - radius: 3 - color: "#224f9fef" - border.color: "#47b" - opacity: 0.6 - } +// Rectangle { +// anchors.fill: text +// anchors.margins: -1 +// anchors.leftMargin: -3 +// anchors.rightMargin: -3 +// visible: control.activeFocus +// height: 6 +// radius: 3 +// color: "#224f9fef" +// border.color: "#47b" +// opacity: 0.6 +// } - Text { - id: text - text: control.text //StyleHelpers.stylizeMnemonics(control.text) - anchors.centerIn: parent - color: "black" //SystemPaletteSingleton.text(control.enabled) - renderType: Text.QtRendering //Settings.isMobile ? Text.QtRendering : Text.NativeRendering - font { - pointSize: 14 - bold: false - family: fontFamily - } - textFormat: Text.RichText - } - } - } +// Text { +// id: text +// text: control.text //StyleHelpers.stylizeMnemonics(control.text) +// anchors.centerIn: parent +// color: "black" //SystemPaletteSingleton.text(control.enabled) +// renderType: Text.QtRendering //Settings.isMobile ? Text.QtRendering : Text.NativeRendering +// font { +// pointSize: 14 +// bold: false +// family: fontFamily +// } +// textFormat: Text.RichText +// } +// } +// } } diff --git a/Controls/StyledSlider.qml b/Controls/StyledSlider.qml new file mode 100644 index 0000000..b03a357 --- /dev/null +++ b/Controls/StyledSlider.qml @@ -0,0 +1,53 @@ +/* Copyright 2018 Esri + * + * 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.9 +import QtQuick.Controls 2.2 +import "../singletons" as Singletons + +Slider { + id: control + + background: Rectangle { + x: control.leftPadding + y: control.topPadding + control.availableHeight / 2 - height / 2 + //implicitWidth: parent.width + //implicitHeight: sf(4) + width: control.availableWidth + height: sf(4) + radius: sf(2) + color: Singletons.Colors.mediumGray + + Rectangle { + width: control.visualPosition * parent.width - x + height: parent.height + color: Singletons.Colors.mediumGray + radius: 2 + } + } + + handle: Rectangle { + x: control.leftPadding + control.visualPosition * (control.availableWidth - width) + y: control.topPadding + control.availableHeight / 2 - height / 2 + implicitWidth: sf(18) + implicitHeight: sf(18) + radius: sf(9) + color: pressed ? Singletons.Colors.mainButtonPressedColor : Singletons.Colors.mainButtonBackgroundColor + border.color: "#fff" + border.width: sf(2) + } + +} diff --git a/Controls/StyledTextField.qml b/Controls/StyledTextField.qml index 24c7543..9275a6e 100755 --- a/Controls/StyledTextField.qml +++ b/Controls/StyledTextField.qml @@ -1,4 +1,4 @@ -/* Copyright 2017 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * */ -import QtQuick 2.7 -import QtQuick.Controls 2.1 +import QtQuick 2.9 +import QtQuick.Controls 2.2 import "../singletons" as Singletons TextField { diff --git a/DetailsForm.qml b/DetailsForm.qml index dbbdd20..4f2160e 100644 --- a/DetailsForm.qml +++ b/DetailsForm.qml @@ -36,7 +36,7 @@ Rectangle { id: tpkDetailsForm - property int maxLevels: 19 + property int maxLevels: 21 property string currentSharing: "" property string currentExportTitle: "" property var currentTileService: null diff --git a/ExportView.qml b/ExportView.qml index db0d550..6a20b22 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -60,7 +60,9 @@ Item { if (serviceInfo.hasOwnProperty("tileInfo")) { if (serviceInfo.tileInfo.hasOwnProperty("lods")) { var availableLevels = (parseInt(serviceInfo.tileInfo.lods.length,10) - 1); - exportDetails.maxLevels = availableLevels > 19 ? 19 : availableLevels; + exportDetails.maxLevels = app.allowAllLevels + ? availableLevels + : availableLevels > 21 ? 21 : availableLevels; mapViewPlus.map.maximumZoomLevel = exportDetails.maxLevels; } } @@ -82,6 +84,7 @@ Item { mainView.appToolBar.backButtonEnabled = true; mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage } @@ -215,7 +218,9 @@ Item { if (serviceInfo.hasOwnProperty("tileInfo")) { if (serviceInfo.tileInfo.hasOwnProperty("lods")) { var availableLevels = (parseInt(serviceInfo.tileInfo.lods.length,10) - 1); - exportDetails.maxLevels = availableLevels > 19 ? 19 : availableLevels; + exportDetails.maxLevels = app.allowAllLevels + ? availableLevels + : availableLevels > 21 ? 21 : availableLevels; mapViewPlus.map.maximumZoomLevel = exportDetails.maxLevels; } } diff --git a/HistoryView.qml b/HistoryView.qml index 36d9ed1..d3374c0 100644 --- a/HistoryView.qml +++ b/HistoryView.qml @@ -51,6 +51,7 @@ Item { StackView.onActivating: { mainView.appToolBar.enabled = true; mainView.appToolBar.historyButtonEnabled = false; + mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.backButtonEnabled = true; mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.exportAndUploadHistory; diff --git a/MainView.qml b/MainView.qml index c1f773f..6f37082 100644 --- a/MainView.qml +++ b/MainView.qml @@ -174,6 +174,14 @@ Item { //-------------------------------------------------------------------------- + Component { + id: sv + SettingsView { + } + } + + //-------------------------------------------------------------------------- + UpdatesDialog { id: uD metrics: appMetrics diff --git a/MapViewPlus/MapView.qml b/MapViewPlus/MapView.qml index a393aff..587841a 100644 --- a/MapViewPlus/MapView.qml +++ b/MapViewPlus/MapView.qml @@ -63,7 +63,9 @@ Item { Map { id: baseMap + plugin: Plugin { + id: mapPlugin preferred: ["AppStudio"] PluginParameter { @@ -80,6 +82,12 @@ 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) diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 3454c9d..0002162 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -314,6 +314,7 @@ Item { } onClicked: { + console.log(map.maximumZoomLevel) if(map.zoomLevel < map.maximumZoomLevel){ map.zoomLevel = Math.floor(map.zoomLevel) + 1; } diff --git a/OperationSelectionView.qml b/OperationSelectionView.qml index a73c21c..99cf744 100644 --- a/OperationSelectionView.qml +++ b/OperationSelectionView.qml @@ -39,6 +39,7 @@ Item { mainView.appToolBar.backButtonEnabled = false; mainView.appToolBar.backButtonVisible = false; mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = true; } // UI ////////////////////////////////////////////////////////////////////// diff --git a/SettingsView.qml b/SettingsView.qml new file mode 100644 index 0000000..506ffb9 --- /dev/null +++ b/SettingsView.qml @@ -0,0 +1,167 @@ +/* Copyright 2018 Esri + * + * 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.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtGraphicalEffects 1.0 +//------------------------------------------------------------------------------ +import ArcGIS.AppFramework 1.0 +import ArcGIS.AppFramework.Controls 1.0 +//------------------------------------------------------------------------------ +import "singletons" as Singletons +import "Controls" as Controls +//------------------------------------------------------------------------------ + +Item { + + // PROPERTIES ////////////////////////////////////////////////////////////// + + id: settingsView + + // SIGNAL IMPLEMENTATIONS ////////////////////////////////////////////////// + + StackView.onActivating: { + mainView.appToolBar.enabled = true; + mainView.appToolBar.settingsButtonEnabled = false; + mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.backButtonEnabled = true; + mainView.appToolBar.backButtonVisible = true; + mainView.appToolBar.toolBarTitleLabel = qsTr("Settings"); + } + + // UI ////////////////////////////////////////////////////////////////////// + + ColumnLayout { + anchors.fill: parent + anchors.margins: sf(10) + spacing: 0 + + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(30) + Controls.StyledCheckBox { + anchors.fill: parent + checked: app.allowAllLevels + label: Singletons.Strings.enableAllZoomLevels + onCheckedChanged: { + app.allowAllLevels = checked; + } + } + } + + Rectangle { + Layout.preferredHeight: sf(1) + Layout.fillWidth: true + Layout.topMargin: sf(20) + Layout.bottomMargin: sf(20) + color: Singletons.Colors.darkGray + } + + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(50) + Controls.StyledCheckBox { + id: timeOutCheckBox + anchors.fill: parent + checked: app.timeoutNonResponsiveServices + label: Singletons.Strings.timeOutNonResponsive + onCheckedChanged: { + app.timeoutNonResponsiveServices = checked; + } + } + } + + Item { + Layout.preferredWidth: parent.width * .7 + Layout.preferredHeight: sf(30) + Layout.topMargin: sf(20) + visible: app.timeoutNonResponsiveServices + + RowLayout { + anchors.fill: parent + spacing: sf(10) + Item { + Layout.fillHeight: true + Layout.fillWidth: true + RowLayout { + anchors.fill: parent + spacing: sf(8) + Text { + Layout.fillHeight: true + Layout.preferredWidth: contentWidth + text: Singletons.Strings.timeOutAfter + verticalAlignment: Text.AlignVCenter + wrapMode: Text.Wrap + } + Controls.StyledSlider { + Layout.fillWidth: true + Layout.fillHeight: true + from: 3 + to: 30 + stepSize: 1 + value: app.timeoutValue + snapMode: Slider.SnapAlways + onValueChanged: { + app.timeoutValue = value; + } + } + Text { + Layout.fillHeight: true + Layout.preferredWidth: contentWidth + verticalAlignment: Text.AlignVCenter + text: Singletons.Strings.xSeconds.arg(app.timeoutValue) + } + } + } + } + } + + Rectangle { + Layout.preferredHeight: sf(1) + Layout.fillWidth: true + Layout.topMargin: sf(20) + Layout.bottomMargin: sf(20) + color: Singletons.Colors.darkGray + } + + //---------------------------------------------------------------------- + +// Item { +// Layout.fillWidth: true +// Layout.preferredHeight: sf(30) +// Controls.StyledCheckBox { +// anchors.fill: parent +// label: Singletons.Strings.allowNonWebMerctorServices +// checked: app.allowNonWebMercatorServices +// onCheckedChanged: { +// app.allowNonWebMercatorServices = checked; +// } +// } +// } + + //---------------------------------------------------------------------- + + Item { + Layout.fillHeight: true + } + + //---------------------------------------------------------------------- + + } + + // END ///////////////////////////////////////////////////////////////////// +} diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index 65a6751..135c226 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -19,6 +19,7 @@ import QtQuick 2.7 import ArcGIS.AppFramework 1.0 //------------------------------------------------------------------------------ import "Portal" +import "singletons" as Singletons //------------------------------------------------------------------------------ App { @@ -40,6 +41,11 @@ App { property string notoItalic: _notoItalic.status == FontLoader.Ready ? _notoItalic.name : "Noto Sans" property string notoBoldItalic: _notoBoldItalic.status == FontLoader.Ready ? _notoBoldItalic.name : "Noto Sans" + property bool allowAllLevels: app.settings.boolValue(Singletons.Constants.kAllowAllZoomLevels, false) + property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false) + property bool timeoutNonResponsiveServices: app.settings.boolValue(Singletons.Constants.kTimeOutUnresponsiveServices, true) + property int timeoutValue: app.settings.numberValue(Singletons.Constants.kTimeOutValue, 7) + Component.onCompleted: { if (!appDatabase.exists()) { appDatabase.createDatabase(); @@ -55,6 +61,22 @@ App { } } + onAllowAllLevelsChanged: { + app.settings.setValue(Singletons.Constants.kAllowAllZoomLevels, allowAllLevels); + } + + onAllowNonWebMercatorServicesChanged: { + app.settings.setValue(Singletons.Constants.kAllowNonWebMercatorServices, allowNonWebMercatorServices); + } + + onTimeoutNonResponsiveServicesChanged: { + app.settings.setValue(Singletons.Constants.kTimeOutUnresponsiveServices, timeoutNonResponsiveServices); + } + + onTimeoutValueChanged: { + app.settings.setValue(Singletons.Constants.kTimeOutValue, timeoutValue); + } + // COMPONENTS ////////////////////////////////////////////////////////////// Portal { @@ -121,6 +143,7 @@ App { property string question: useIconFont ? "u" : "images/question.svg" property string redraw_last_path: useIconFont ? "d" : "images/redraw-last.svg" property string sad_face: useIconFont ? "w" : "images/sad.svg" + property string settings: useIconFont ? "G" : "images/settings.svg" property string sign_out: useIconFont ? "c" : "images/sign-out.svg" // property string spinner: "\ue982" property string spinner2: useIconFont ? "i" : "images/spinner2.svg" diff --git a/UploadView.qml b/UploadView.qml index a276069..2aaa013 100644 --- a/UploadView.qml +++ b/UploadView.qml @@ -67,6 +67,7 @@ Item { mainView.appToolBar.backButtonEnabled = (!calledFromAnotherApp) ? true : false mainView.appToolBar.backButtonVisible = (!calledFromAnotherApp) ? true : false mainView.appToolBar.historyButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.uploadTilePackage } diff --git a/appinfo.json b/appinfo.json index 819406f..f2f6d10 100644 --- a/appinfo.json +++ b/appinfo.json @@ -8,6 +8,10 @@ "camera": false, "fileSharing": false, "highAccuracyLocation": false, + "ios": { + "externalAccessoryProtocolStrings": [ + ] + }, "localnotification": false, "location": true, "microphone": false, @@ -71,6 +75,7 @@ "arcgis-survey123connect" ], "mainFile": "TilePackageKreator.qml", + "multipleInstances": true, "projectFile": "TilePackageKreator.qmlproject", "properties": { "mainButtonBackgroundColor": "#196fa6", diff --git a/fonts/tilepackage.svg b/fonts/tilepackage.svg new file mode 100644 index 0000000..972ef61 --- /dev/null +++ b/fonts/tilepackage.svg @@ -0,0 +1,43 @@ + + + +Generated by Fontastic.me + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fonts/tilepackage.ttf b/fonts/tilepackage.ttf index 5127c91a822ac4fbc12e4b1788710ac4a91c9390..deec55685f6ee9a45f9e77fc355862127ecee3df 100644 GIT binary patch delta 1207 zcmZuxO>7%Q6n^i`?9Bcg! z%1Zm)?t%8HbLY>rUfOy7ZPqO_|LAJ#^>tXK+nm{CJhj$ZZGZO0)vEyeFEh8Zetu)K z`s_8uU_#1fUJOJO^`18=e>lIwU`+AFb3y=36pqH`Sdxge( z+w`;a{s7p1Uwj*Nc~BT7z+b?Daj3x-T*pa1=UlZ?Qc*t1Vy?<1twy6b-$=4_cz_2` zk49RRwbJ=G&lT6D8RSK)Ls+U-=Bt&eR;HNC(rgj4%8a2GkYR(FZe`F)8%YsUX40dW z#QD)UA7`m4A{}B5^F_nPW;4xP&V*EXuWE?AWu-b_oy$0?pPTV!$^0=&;sVB;8>h#R zPsd*VAHF-HyDMX^#E0A!lFeuAyl2X-Xyiz(c4Xv7*9&rv=lX%~yRPqt?x5}viaKd0 zM`VXX7RsXM2#I=DkWitTA|)!MEb7`^)v5pcPrpx)EO@REtS3p@w~I!Pq=j$ExmZI7{Ox?R&wzfHFukEL16xEuw z=xLtLb8`Jjv0xT&!c2X3R-#Zk^!JgCZa73^mMFTK1l27uMxv|*IhOD#a1@Wr%45WJ^R>4!OP(c;$XeXkAo@Bf$_MqHhH%KvYGog~d%}o2KPhf%LgQ z;-U6U+h()B$4tK5W8VLdTZw@^a{sq)Ul<$4;RI5ch6X}^f_wH$QXtqU8|8|}@_7uP!GE&}owg6|kt{M~>tL-nzMGPAOe R3}+N@ZQz{tSBz{}9Uz|0Wf<`&{x?zepf1B3J)ps0+yi>n($00SG4KL^NH@DJ8E z@_!JspMilf0>}?b&P^=XaJiL_fq@CgWeiGBEH3!}A7~PT^c0`~M|w_Wn)$-jj~E!3 zf%-*mWTYmh@EC_)0Lt9~VzZ2l)QR;nseU>6$%%3MlG=dkLV)5Pxrr483^`0cfo56& z`3iZ7xv5*r)~sV-kSGC)Z7awxE;*WdDVKpkN(abK1N#B!k383xPVxLUUm3VT?qOiK z+R>E*qbD)iGAd8DV|>r(Hd&7;dvYO@)a1=fFE=k>zA3VKqBI|)pdo_+gD!(P5E}tm zh79JDH^?Y(8XD-D>lzstnom}gRh#@@CJSgvmaN<4O|t(c?~{{fRGNHGPKpQFCIBjq BTulG~ diff --git a/fonts/tilepackagekreator.ttf b/fonts/tilepackagekreator.ttf deleted file mode 100644 index efdf1504b59906732b4925dac7fe471a97bdb4f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8532 zcmds6du&_Rc|YeKKE$_Zl9!f9QGAG`BShxI9Ur=*CxkNU|z>PHS^H)x$$?$ zKVXap(f-BU^!ammwxj)PJlp0TymJ)Ri;?< z&(ZG18rE|Q=P!UyT#+30Ga>$gKh2Ej`;PKAzIj=pfFA%C24)8?yeyVe%X^pSmmgk!bopz`OUplA z{;TDGT>j+^^9}or_8UX*cfNmQZFOx8qZp`J3-wne^^qA-P z9rd+~OPpT>^wDEWE595m@k^!BQmMo*VwqFlTKeeND@(_(E`4<1o0ku)RDpMv_(bWC zixdLGx-M+Yhn3wCcNTZV9dnChBp)dz&Hkc+tyZhNTCY~0nNxmu^|86&l`BDUb%pU- zy(ZWikNO`ysoC`A7>Sw+A(lA@1|8kBs>;h32q)E`f=Y#cUG#iE-E`OGe5{$Y(Gv-O)K3 zjqmSI?2g7pI|BpmO{(dcx88cm;Ii9;ZZ#L|+7=FP>k6cNdrz&*d}ZazwW-s4Ynd6o-d)-MdrVfvVy0WT2>af|5 zyV_j?!N885p8fs(`+K_b{yleXF0FjuS9*T)2tU{{(oF$ETNgrDlo3Hz#^Roc@CbLr zAMuHDZKYO&y~0&~1$1?$lvit_T&-dR+F^_H9hJE%G!8# zTyP&e!lzVEyl`o9^3n?@c2zT(d_I$@?gEs^SpMw#^%rgXzVt2bTVqvGB@!Z?YLF0d z;$#j!!VW$)Hwqu(<(lLlKEl99mK_Hl4WICNr2|NF`=wW8x030z4QuPBh8yM64d$bX zq*Ivl<6L%%d~RG(Sl|9cY`im*celH<-Tp3v!nx6A+BDo@Xfw2j+Z)~aOy_tkvA^%^ zYfm0H@Z@V}y}jPP-##&w%I@WSU@{#5PB4eV9`*Ij7DA(euB_KJ6tHZv7_6pE9)0Q=SwG9M3C29RLNVz?=!6u1afrteLjG~6D3LUWIES8#Ln7%j zLe+WbkUJ5cvWpa+ta1LT!RYTFO)Mq{mFi$}F)`ZjHyU2$e2v|CF7j&N(A>p4>OYE{ zyYr5VbB6-Tk?x6DY@&Oy_~^vMqs2vDgQCX#sgC05lSg9DZCMx}U)b_o?8wQ}#g3GJ z%(986org!qw$9v>ZhQ0D(ZkL++tT;UY^@8Y%jNuTC=v;MSNg0bSB-VRTi`2B#XK&u z()ud+%tKuwGp-b!A{HG|AR9cG1XkFYSH6BoC=(AqbCgs+(%U;iHoh%Z)b>68^6C4Y z|I$wK;ogyvUUG>Qc0264|JIb9h9zh@J;Kvo)u(!4Ln@jBYqje2YhHb87xuJP%3ERV zhZ!~7zyr_VJC2u}><68S_9_Msx*1+;6UByve@ z2fwvzh~GrnI!c4#uF*uSfd`-!LZYOi)CADaV~Hpg0B{iCiJ_<|W{SdFs5IY608CM{ zwj0s9)MN|iIVbC6F`vrOkOHM1OX>}F_lX<^x0Ibj%g^I)cdIh zYT6Wlv^8u>o`90dq=A9EY~@sgK*G8MX>J6XOsd4OOeO_KqZe}14Kr$5`eUn05`jk3 z@KYVrY&HV|fQ$xsJ;h4Kn}+njKp8=R(4Yg0~?G8iFeZVe#4R9ZpA=(-m@wHUqj8p%}~t(Ix;8Y%&NlV2&XQ7bYO_ zP=rwkBPNM=Vj>f8m=*IWMvKvCGZLA}KudzsjD=`DOl}q^`n*`fY-qyHpu^E&vwN); zmsw+#rUZ|4$>9X&l2BgygW%4dyBn>RryM}*(Kn4$j6rGhSZyk-=&*M>3{7sp0l^#v z02r0}M3aP&#s|tE@I{0%=p+0-8+YolAUD@~wTK%c8QuUV5GV->7n-)y(}tX6kh zo5M)9)9t21)Yh($+JKsJONKNo@nMi1SaV%CyQ9;g`JuL$WLmmcLpWNeML0!B;mG?M z!a*bm7lo64UZQoY{0&{z(6<&1@DdZL=Qdsf{k3>TingpiRA=%!e>O`vQ0QZvv&-VzFWoZl`KK2O2c z!~C*F~|A;PU)1 z4y1N27S})YB-^*7$Ij5{@XQ!Jaqi{q?zaPb0-c7{ujWro_V!Mm$m`GFdfVO3aX4-e z(=)xLJ?Z%{Watd+;Ytgw90MNBth`neRq$wG4(3K4rh^T#G)@(6ubPeE^V!Xjee&FN z<5OS@PR(8Ph0?_%Xhx9ms3tm%H?XKJpE44d)*s+#~T#oVEq@hno?b@b|yes zU9BO5Q(nJ$`G7YV^d3L~upPWfCE~1FWhUfXU5r_jEHXrbQbcAfs9aw|{^v?w{OPFcgzI3O8cXRJnNFxYlnPWCl3w` z9Gu+hJJfamwr%%!{RYxr*EH0aFJ9l5iIw_PwXYP*q{qhK;FQ90!uLOf?+f^Sgbl;P zc!cM{DK|;yPp0u@8%ukn-Eho=4e`CbjZ3JDdrb=CKUw(!|B1WXQQy-M&x-rA@s9c) zN4LA&Sh}opB4$>8D2|^{{VU%YD3=GsoL^n3>3x-WK!T_wUyYoDfX9xoz3^H}EoRg% zWM}imd?a6_JOr{elvxQO9f1S{C02%%B|GR3?HM?2cf zXwDc`V;+aVtRBZo+2K*b5~K>_3{4(gawnveS*`%CpnIjyx;#+2GdRjy2JjBS!vS$k8| z#T&FY#gSdGa8x)(7ZStpVLFvIkT|O)OfDQC>7?91qF;XzVN3&wezmY2hjF~Q#K-k( zyofJjd@}yNd6Na-l=W-%Yl=x&HUS|7od}9Rv{LXQhO|&Tu@Qke{yMVX*FAo>2SfsS%_84N>ckioLpo#`FxH{&(pp#(I{mMlixMJB{HU`CmSZ>`VX2d5H~2` zV)}b+Ud-dKOM&eNXI>Y_n_-wIig2}jj_Qmb9+yS!6H&9tjQovX^&|0CEEJLON+yzt z823^~EJ_U;RK)&7M97$%UN)J{rmGgC!7*<%w#~O0jdWi-x@&h|e}CWZT}O}X-qnw5 z*X|?y>gZ^t^5sWnE2Fq7vyXha0*Jq8Hot5#y==AGuVEx6xrUqHC5LR7rhaY1U^yXt z@?PdrUJ@^{PI`Ca^(Vzla^jYQ*=`P;S$VGhGd^syowPY!w)(v`8-K~>a-wMyw)#8u zpV?e4D;mI}AGJmZJ#u7ZUCP(=`E?CqY6~r}ofhzG3tYskE*H(nQ}uUf0<`!`Rx5v# z);npX<}gp`%M!KIruiB6k?+mC_-`j&WBE{P*h7^(X#dmEmFdw@dyeFN~4@ zNSUFG-Q>Se19Q^_?_IxW7`63#7*C^w%jD$}U)G-u8hYLi=e!M_(!jyr$o1}3u2Lo& zmz8;0h|RL^v$uJbKg+KxUr@fTd?d;iujPKrpIZLj@@wn7^`C7i+q1U6wf)L|x4mZn zJ4e{@2acaQ{vG2E>19K&oa~Qu**V(;oTdi_BmP2%1@Omp*Z}xl9X8^N zub{&w;GfcAE9>M=h`|jOV0zG_!3uM-w{%zle@2H5fN$uqk*REl4x4~~UWctL$9pfF zd9ZSBdgg)Yxyl2JmFWu$i}-hVhCPV?i09Zen_&;2o=e6*`Yz~e0pBePl6DA| Mm*4WOu5mN`-?Eb?Bme*a diff --git a/fonts/tpk.ttf b/fonts/tpk.ttf deleted file mode 100755 index 3dcabbb98731b4af49c05aeeb9eafeddb568b13f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8352 zcmds6du&_Rc|Yf#OHveHqDfv_B1Q3Gl9H?k-xMubW+F#+?D+l4nz)v2DYD%}a%{Ja zjiun4Ku#JI39zM)!D&6DEwWGrz3Q`!^#I4BbH^W> z*>UB~-$T0>YaTv3fBpjaq^=rOOo)HrFE9(%|E}^5Fwg5x{;w?0?P#}N9BkiyRT;Z= zP}EoItSWG$lXPKTQ3=p$bcfNWKZT?UGnLhW9{?9Ba{?D#6pNX~U5j&zk1syC_|)RU z;-4)3_2NG+{_3Xfrt@aU&7oUew+^l>udHAc12t=*{<@_8D}&m8(<7-5NNT?FPeE0C zUwc!#qWz)vy!M>-tTwIf&2k#~pnNzu zxZE*lL4UPUAum{Y1HAk>ThF>#j3rqgII)2P+!kUa2|mjCB1$5_!HTSW0Ft=HrH`NX z9l5u$a&dw4i-10UdSU5TBNcwBQdy`}_(d#p;@b-!AAW7&$hC!!_kQd0-lZDw?h2o% z{8^boVA#-wg9Wg%H|EXbj(HPak&YE(<+LqWR@ri`#%qmQ?ZsK;cbA`@4PU()7T1;- zuQ%#~tuS6&zA{~%CN!*PVV0G;Y7wuo8Fq%vvkUB!u3g&@PY>}#+-h@kqa=dm#5gaT zC7;uR5gvr>A`u`hkla4hKt_1LzdAAz$d#JIiiH#=PM7m(=qJHppF9~UFQI^HS-7`r zG@jhkpV}TzjCO?vyz4aUi$D9>E2_uo412XgxO;Ony16@)3G6ztbnD8^Mq4W70UR>?(_fZweoic*`p9t{KK z9XvlScmN&|P-;hCzBD;`>E)x_YPnpon9J3+0ZQfUe|h7^4;{O|@@*biVKq@B5+a>4 zNr*UgtNp&M#Zej zd_0wQ3tMrV%T7@&j4KN3+mlL+cjb!S4sX6E*sUs@TO8JP!<}lI+7azAyNkK5@kDA* z-iZwqqeu zv<^-j$z+a93{u=Nsna*HKlZSGR$vp1`3j|S+KteOD8cd&Pa=eZ<4{p5ZHsUYJ(q_> zI$(jSi_jr=BRpjnDLh^0{B_k5>>o{?OAjiw!SuP*Xn)Y6zRvjyyYFo5_0ay=i}yBu z96Nj8y%%Tqhm?ao6N$t`&$;rG6BAFC&+$4GH5SZtmQNi!n0RU9{P_6%#+MQYkDV%a zW`bk(bv)}nFgmvBwN&+2m3Stq;&zT#GF z<03DuuYu1Z)FpD`O4%(E@gW7W!GlR)g`Ixw8~cSa@%W2}NcAJVy(47fyJAIs_cO1a zdg%LK*-Ad#J2KKsF0sV!hF$gFy0TSWfR?i(JnPp2njbc#qC2o&YyP0_)pvGbPiv*T z6UKg+)AA-BfL;iRlF3mMz$Tv8a#V7eEHJ<)S<035aLSd4rnPGv zF~7PUH#gYZfIgX6^faHbmvlWj8hY3jMyMNF;qwuQw7+EihLK)u8oo^ zr1c&A&aNST8)fS#9frHcQwb9fKre(u$;7D%pr0pFaVh}dAixttacjaFhqq8^zLNl0 z<2HRqy0Z%r(n@(Jj0p2v1127TUI>Yj@lz8(mWO7+x;4Ygu)gX|t;Xt|@fhL!!a4eI{z|rW1+;qd7mX-e4>XJmD z)0lp0V4BTlKmd@@0I#Q5$@#O89vCPi%&7)}gbnrRO3L`N8GnT~D?qwprG`n#ervV~ zn>t_py!h`hO>+Z~wuVi~6a4Wk`~w)&{hVqLNZ4>7!0@3=Je!H*D~j9TeQ>>|55`kj z>5Q%ZX!y8JY5J*w)SJy{03bsFE>D3HFJuuuz#y8&IMpDKun}K+l)-H>g$l=9j2jnT zcB_}!5S$AMD+=C*C};?-sKOp_Iy>F2Znr1m5p62E6rrd#RkR5J1Y1>M1I#f*;lc_e z9*VFCVZkKHE=*(v4zprD#bUQu92O$8sTMx`p757JlH|4}>` z;Xqvd{}xnkaQA$k(Gb-Ao@(8`WN8XOLdZx5bXzRkCD8SKsTt@XZwUn>&hHiqpQm7} zVgA39OWZBSe=E5Xl=z}^^2+<-17ynLtc24R-n%wBCz=PYh=OmRvQ_KB*G0LM;`013 z4y1lA7B@cfr8_oe$4=Af@bnlxaqi_E-giSgLtX0f*NaCddwVC37LDicyzA}YI2@bA z^vrJTNc%pDs9m9*Txp?|W5A=0Rafew1|IFq#k|PFbh1H~#i_#U*YYuZK6^Q`Prlo3 zd+pvt zyj64Qs=HgM9}|PKg_ht3FrVdGyGgkWyxa61aly{Z{OHsiH4dL_WNTtw_kc8ExbG zULe-&;JhC8M`=?-RbRorh+S%pX3wmNcjX0xKJ0Jo1^o(B>T6ZGG_^LiNnT~;ZP5^K z(cY9qcEQe3;TT;?4a0}&RB9q|R!dnuI6%@#*+in>coAWYiA29v+JeJ4-dy67#&urC zmoYvWf8Vywj&I7w^~QC@D(vfk5Q0twWguE9co{=lD4t!5z#RY6Nu_OBROX*86tQWW zor|eP^u|?QQ);40Py>*B|JFfAxw{;OAvDNfdF;;gjt$!I8u3vA8fHtEW8ShJNkwrf zacJty2w6&Mdg#cW`?|lyrxsGAcfHlPy3iyNU8(VnL9!AV)3+fXCE~`9nk^8U6mT)) zy*4N2@Ykip_JA|LhvUsK%u{8!TCqTNE(njyqYj9;&1ysbCa49Gcq^C6NO+}F=~ROI zsUs1m1`R4>eP-)#4D_e-racpNiox$xaDBBhXZF*UTXZD4?7&k9Bz-J@u0)OUvYTcXgY+W@m}NS z4v(iD4PeoaS|@}aIWn>y)UA<@+wT*iiPm6@Blpkf5iS5_P@9PrhTscpB)*;702H?e(l`htULeC z6?OfA>!&W#07(^9FEblW)|6g0jLOaa)R0~O7p&_+!H6*fFThg20V7n|J_EMki_dPr zR^amn+zwy*0@_@qUh2_dg}L#^L5BtKg9fYuK4`!era@wz#tMANfZOr6;=+ZqU&7DA zv+PTUXU?5JJwF%C4rSP3{6##+&a>0_lQ_qs_%0q|nI>fu*grG-7^=n`K{S zkFw+JT(fs_e(pkac4lto-0=%D)6o+bqxYYj-!(r!H^e68ycaO@EQZd>)sBOW8CWIC bPOyup?`J1LwF@`#Fa*uY@8VW9-wyv5?mzN9 diff --git a/images/settings.svg b/images/settings.svg new file mode 100755 index 0000000..67fd8fa --- /dev/null +++ b/images/settings.svg @@ -0,0 +1,5 @@ + + +cogs + + diff --git a/iteminfo.json b/iteminfo.json index 1b8b7e5..c251cf3 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -10,7 +10,7 @@ "commentsEnabled": true, "created": 1481688674000, "culture": "en-au", - "description": "\n

Tile package creation tool.

", + "description": "\n

Tile package creation tool.

", "documentation": null, "extent": [ ], @@ -22,7 +22,7 @@ "languages": [ ], "largeThumbnail": null, - "licenseInfo": "\n


", + "licenseInfo": "", "listed": false, "modified": 1508277493000, "name": "561a8441825441349a3b1ad23fdaea75.zip", diff --git a/singletons/Config.qml b/singletons/Config.qml index 45ec20c..4901750 100644 --- a/singletons/Config.qml +++ b/singletons/Config.qml @@ -33,6 +33,7 @@ QtObject { "tileItemBorderColor": "#eeeeee" } + property bool rtl: false property string mainButtonBackgroundColor: "#196fa6" //property string mainButtonBorderColor: "#007ac2" diff --git a/singletons/Constants.qml b/singletons/Constants.qml index d7bb90a..1ea9f36 100644 --- a/singletons/Constants.qml +++ b/singletons/Constants.qml @@ -36,4 +36,8 @@ QtObject { readonly property string kDatabasePath: "~/ArcGIS/Data/Sql" readonly property string kDatabaseName: "tilepackagekreator.sqlite" + readonly property string kAllowAllZoomLevels: "allowAllZoomLevels" + readonly property string kAllowNonWebMercatorServices: "allowNonWebMercatorServices" + readonly property string kTimeOutUnresponsiveServices: "timeoutUnresponsiveServices" + readonly property string kTimeOutValue: "timeoutValue" } diff --git a/singletons/Strings.qml b/singletons/Strings.qml index 761e1e8..0623c14 100644 --- a/singletons/Strings.qml +++ b/singletons/Strings.qml @@ -30,6 +30,7 @@ QtObject { readonly property string addTileService: qsTr("Add a tile service manually") readonly property string addTileServiceDesc: qsTr("This control will reveal an input form which the user can enter a url for a tile service to add to the list.") readonly property string alertMessageDesc: qsTr("This alert message provides information about where .pitem files are saved, or if there was an error.") + readonly property string allowNonWebMerctorServices: qsTr("Allow Non-Web Mercator Services
NOTE: Map may not display but export will still work.") readonly property string animatedSpinner: qsTr("animated spinner") readonly property string animatedSpinnerDesc: qsTr("This is an animated spinner that appears when network queries are in progress.") @@ -67,6 +68,7 @@ QtObject { readonly property string deleteBookmark: qsTr("Delete Bookmark") readonly property string deleteExtent: qsTr("Delete Extent") readonly property string deleteHistory: qsTr("Delete History") + readonly property string deleteTileService: qsTr("Delete tile service") readonly property string description: qsTr("Description") readonly property string descriptionCopyPaste: qsTr("Copy and paste description text here.") readonly property string descriptionCharCountDesc: qsTr("This text displays the number of charcters left available in the description text area.") @@ -85,6 +87,7 @@ QtObject { // E ----------------------------------------------------------------------- + readonly property string enableAllZoomLevels: qsTr("Enable zoom levels greater than 21.
NOTE: Exports often fail above level 21 regardless of area of interest.") readonly property string enterATitle: qsTr("Enter a title") readonly property string enterUrlForTileService: qsTr("Enter a url for a tile service.") readonly property string estimatedOutputSize: qsTr("Estimated Output Size") @@ -174,6 +177,8 @@ QtObject { readonly property string selectAnOperation: qsTr("Select an Operation") readonly property string selectTileService: qsTr("Select tile service to be used as the source for the tile package") readonly property string selectTileServiceDesc: qsTr("This control will select the tile service to export tiles from and will transition to the export area and details selection view.") + readonly property string settings: qsTr("Settings") + readonly property string settingsDesc: qsTr("The settings view allows you to change various parameters used in the Tile Package Kreator") readonly property string shareThisItemWith: qsTr("Share this item with:") readonly property string sharingItem: qsTr("Sharing item.") readonly property string signOut: qsTr("Sign out") @@ -186,10 +191,11 @@ QtObject { readonly property string tileServiceThumbnailDesc: qsTr("Tile service thumbnail image.") readonly property string tileServiceTitleDesc: qsTr("Title of the tile service.") readonly property string tileServiceUrlExample: qsTr("Enter url (e.g. http://someservice.gov/arcgis/rest/services/example/MapServer)") + readonly property string timeOutAfter: qsTr("Time out after:") + readonly property string timeOutNonResponsive: qsTr("Time out non-responsive services when querying available services.
Sometimes services go down or change. This will kill the request to those in the time set,
rather than waiting for the Network Request to time out, which could be up over 60 seconds.
") readonly property string title: qsTr("Title") readonly property string tpkFilesOnly: qsTr(".tpk files only please") - // U ----------------------------------------------------------------------- readonly property string updatesAvailable: qsTr("Updates Available") readonly property string upload: qsTr("Upload") @@ -249,4 +255,5 @@ QtObject { property string xUpdatesAvaliableDesc: qsTr("This button is enabled when there are updates available to the application. The action on this button will only work when the button is enabled via the application.") property string uploadedSeeX: qsTr("Uploaded. See Tile Package Item") property string uploadingAndSharedSeeX: qsTr("Uploaded and Shared. See Tile Package Item") + property string xSeconds: qsTr("%1 Seconds") } From 3c661309ec31bd5040e86bbfecc0d4300764d9ea Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Mon, 26 Mar 2018 16:44:28 +1100 Subject: [PATCH 03/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/appinfo.json b/appinfo.json index f2f6d10..d0eb8c1 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 1, + "micro": 2, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index c251cf3..69920fc 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -10,7 +10,7 @@ "commentsEnabled": true, "created": 1481688674000, "culture": "en-au", - "description": "\n

Tile package creation tool.

", + "description": "\n

Tile package creation tool.

", "documentation": null, "extent": [ ], @@ -22,21 +22,22 @@ "languages": [ ], "largeThumbnail": null, - "licenseInfo": "", + "licenseInfo": "\n


", "listed": false, - "modified": 1508277493000, + "modified": 1522043047000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 39, + "numComments": 40, "numRatings": 0, - "numViews": 159, + "numViews": 240, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, "protected": false, "proxyFilter": null, + "scoreCompleteness": 65, "screenshots": [ ], - "size": 849340, + "size": 851713, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 9104c0c6d7a6ead26405b1f4a81f4acd99bcbcad Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Tue, 27 Mar 2018 16:41:02 +1100 Subject: [PATCH 04/29] #60 shape files now work, but only the first feature --- MapViewPlus/shapeFileToGeoJSON.js | 118 ++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 38 deletions(-) diff --git a/MapViewPlus/shapeFileToGeoJSON.js b/MapViewPlus/shapeFileToGeoJSON.js index 1f245ac..a790f02 100644 --- a/MapViewPlus/shapeFileToGeoJSON.js +++ b/MapViewPlus/shapeFileToGeoJSON.js @@ -27,6 +27,9 @@ WorkerScript.onMessage = function(shapeFile) { } +var partsArray = []; +var pointsArray = []; + var shapeTypes = []; shapeTypes[0] = {"esri": "Null Shape", "geojson": null}; shapeTypes[1] = {"esri": "Point", "geojson": "Point"}; @@ -124,6 +127,8 @@ function getShapeType(val){ function resetFeatures(){ geoJson.features = []; + partsArray = []; + pointsArray = []; } function shapefileByteArrayToGeoJson(byteArray) { @@ -176,9 +181,9 @@ function shapefileByteArrayToGeoJson(byteArray) { "coordinates": [] } - if (shapeValue === 5){ - geoJsonFeature["geometry"]["coordinates"][0] = []; - } +// if (shapeValue === 5){ +// geoJsonFeature["geometry"]["coordinates"][0] = []; +// } var boundingBoxXMin = shpDataArray.getFloat64(shpHeader.xmin.position, shpHeader.xmin.bigEndian); geoJsonFeature["bbox"][0] = boundingBoxXMin; @@ -202,13 +207,15 @@ function shapefileByteArrayToGeoJson(byteArray) { geoJsonFeature["shapefile_related"]["box"] = [shpDataArray.getFloat64(112, true), shpDataArray.getFloat64(120, true), shpDataArray.getFloat64(128, true), shpDataArray.getFloat64(136, true)]; geoJsonFeature["shapefile_related"]["numParts"] = shpDataArray.getInt32(144, true); geoJsonFeature["shapefile_related"]["numPoints"] = shpDataArray.getInt32(148, true); - geoJsonFeature["shapefile_related"]["Parts"] = shpDataArray.getInt32(152, true); - geoJsonFeature["shapefile_related"]["X"] = (152 + 4 * geoJsonFeature["numParts"]); +// geoJsonFeature["shapefile_related"]["Parts"] = shpDataArray.getInt32(152, true); +// geoJsonFeature["shapefile_related"]["X"] = (152 + 4 * geoJsonFeature["shapefile_related"]["numParts"]); + + console.log(JSON.stringify(geoJsonFeature)); - // can only handle one feature currenly -------------------------------- - if (geoJsonFeature["shapefile_related"]["numParts"] > 1) { + // over 100 parts? then not gonna process currently ----------------- + if (geoJsonFeature["shapefile_related"]["numParts"] > 100) { try { - throw new Error("This tool currently only supports one polygon, line, or multipath feature per shapefile."); + throw new Error("This tool only supports shapefiles with less than 100 parts."); } catch(e) { WorkerScript.sendMessage({"error": e}); @@ -218,47 +225,82 @@ function shapefileByteArrayToGeoJson(byteArray) { } } - // over 10000 points? then not gonna process currently ----------------- - if (geoJsonFeature["shapefile_related"]["numParts"] > 10000) { + if (geoJsonFeature["shapefile_related"]["numParts"] > 0) { + try { - throw new Error("This tool only supports features with 10000 points on less."); - } - catch(e) { - WorkerScript.sendMessage({"error": e}); - } - finally { - return; - } - } - // You've passed all the checks, now cursor through the data ----------- - var pointShapeType = shpDataArray.getFloat64(156, true); - console.log(pointShapeType); + var cursor = 152, x = 0; - var cursor = 156; - var points = geoJsonFeature["shapefile_related"]["numPoints"]; + for (x = 0; x < geoJsonFeature["shapefile_related"]["numParts"]; x++) { + var pointLocation = shpDataArray.getInt32(cursor, true); + partsArray.push(pointLocation); + cursor += 4; + } - for (var i = 0; i < points; i++) { - var pointX = shpDataArray.getFloat64(cursor, true); - cursor += 8; - var pointY = shpDataArray.getFloat64(cursor, true); - if(shapeValue === 5){ - geoJsonFeature["geometry"].coordinates[0].push([pointX,pointY]); - } - else if(shapeValue === 3){ - geoJsonFeature["geometry"].coordinates.push([pointX,pointY]); - } - else{ + console.log("partsArray.length: ", partsArray.length); - } + var nP = geoJsonFeature["shapefile_related"]["numPoints"] * 2; - cursor +=8; - } + for (x = 0; x < nP; x++) { + var point = shpDataArray.getFloat64(cursor, true); + pointsArray.push(point); + cursor += 8; + } + + console.log("pointsArray.length: ", pointsArray.length); + for (x = 0; x < partsArray.length; x++) { + + if (shapeValue === 5) { + geoJsonFeature["geometry"].coordinates[x] = []; + } + + var pointStart = partsArray[x] * 2; // e.g. [0,320,333] + + console.log("--------------------- x: ", x) + console.log("pointStart: ", pointStart); + + var lastPoint = (x === partsArray.length - 1) ? pointsArray.length : partsArray[x+1] * 2; + console.log("lastPoint: ", lastPoint) + + var numberOfPoints = lastPoint - pointStart; + console.log("numberOfPoints: ", numberOfPoints) + + var coordinate = []; + + for (var pointCounter = pointStart; pointCounter < lastPoint; pointCounter++) { + // 0 : 0 --> pointsArray[0] to pointsArray[319] + // 1 : pointsArray[320] -> + console.log("step: %1, pointCounter: %2, coord:%3, cLength:%4".arg(x).arg(pointCounter).arg(pointsArray[pointCounter]).arg(geoJsonFeature["geometry"].coordinates[x].length)); + + coordinate.push(pointsArray[pointCounter]); + + if (coordinate.length === 2) { + + if (shapeValue === 5) { + geoJsonFeature["geometry"].coordinates[x].push(coordinate); + } + else if (shapeValue === 3) { + geoJsonFeature["geometry"].coordinates.push(coordinate); + } + else { + + } + coordinate = []; + } + } + } + } + catch(e) { + WorkerScript.sendMessage({"error": e}); + } + } } geoJson.features.push(geoJsonFeature); + console.log(JSON.stringify(geoJson)); + WorkerScript.sendMessage({"geojson": geoJson}); return geoJson; From 695ee48a865cb93662da02ca45e752e4910ad9e6 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 28 Mar 2018 16:56:09 +1100 Subject: [PATCH 05/29] #60 Shapefiles with multiple features now supported, can iterate through all features. export to geojson --- MapViewPlus/GeoJsonHelper.qml | 62 ++++-- MapViewPlus/MapDrawingMenu.qml | 35 ++++ MapViewPlus/MapViewPlus.qml | 164 ++++++++++++++- MapViewPlus/shapeFileToGeoJSON.js | 322 +++++++++++++++++------------- TilePackageKreator.qml | 3 +- fonts/tilepackage.svg | 1 + fonts/tilepackage.ttf | Bin 7940 -> 9188 bytes images/geojson.svg | 53 +++++ 8 files changed, 476 insertions(+), 164 deletions(-) create mode 100644 images/geojson.svg diff --git a/MapViewPlus/GeoJsonHelper.qml b/MapViewPlus/GeoJsonHelper.qml index d24f2a8..554de8b 100644 --- a/MapViewPlus/GeoJsonHelper.qml +++ b/MapViewPlus/GeoJsonHelper.qml @@ -35,50 +35,77 @@ Item{ property int inSR property int outSR + property var geojson: null + + property int currentFeature: 0 + property int numberOfFeatures: 0 + signal success(var geometry) signal error(string message) // METHODS ///////////////////////////////////////////////////////////////// + function setGeoJson(json) { + geojson = json; + numberOfFeatures = geojson.features.length; + } + function parseGeometryFromFile(filepath){ - if(geoJsonFileFolder.fileExists(filepath)){ - try{ + if (geoJsonFileFolder.fileExists(filepath)) { + try { var json = geoJsonFileFolder.readJsonFile(filepath) - _normalize(json); + setGeoJson(json); + getFeature(0); } - catch(error){ + catch(error) { error("There was an error reading the JSON file."); } } - else{ + else { error("JSON file doesn't exist"); } } //-------------------------------------------------------------------------- - function parseGeometry(json){ - _normalize(json); + function getFeature(feature) { + if (geojson === null) { + error("No geojson data."); + return; + } + + if (feature === undefined || feature < 0 || feature > geojson.features.length){ + feature = 0; + } + _normalize(feature); } //-------------------------------------------------------------------------- + function _normalize(feature){ + + if (geojson === null) { + error("No geojson data."); + return; + } - function _normalize(json){ + currentFeature = feature; var features; var isWebMercator = false; - if(json.hasOwnProperty("features")){ + if (geojson.hasOwnProperty("features")) { - if(json.features.length > 0){ - features = json.features[0]; + if (feature === undefined || feature < 0 || feature > geojson.features.length){ + feature = 0; } + features = geojson.features[feature]; + // Esri geojson has crs property ----------------------------------- - if(json.hasOwnProperty("crs")){ - var sr = json.crs.properties.name; + if(geojson.hasOwnProperty("crs")){ + var sr = geojson.crs.properties.name; if(sr.indexOf("3857") > -1 || sr.indexOf("102100") > -1){ isWebMercator = true; //returnGeometry.spatialReference = 3857; @@ -94,8 +121,8 @@ Item{ // Esri json has spatialReference property ------------------------- - if(json.hasOwnProperty("spatialReference")){ - if(json.spatialReference.wkid === 102100 || json.spatialReference.wkid === 3857 || json.spatialReference.latestWkid === 3857){ + if(geojson.hasOwnProperty("spatialReference")){ + if(geojson.spatialReference.wkid === 102100 || geojson.spatialReference.wkid === 3857 || geojson.spatialReference.latestWkid === 3857){ //returnGeometry.spatialReference = 3857; isWebMercator = true; } @@ -112,7 +139,7 @@ Item{ } } - if(json.hasOwnProperty("geometryType")){ + if(geojson.hasOwnProperty("geometryType")){ returnGeometry.type = json.geometryType; } @@ -160,7 +187,6 @@ Item{ else{ error("JSON is missing 'features' attribute"); } - } //-------------------------------------------------------------------------- @@ -233,7 +259,7 @@ Item{ //-------------------------------------------------------------------------- - function saveGeojsonToFile(geometry,name){ + function saveGeoJsonToFile(geometry,name){ fileDialog.geoJsonToExport = geometry; fileDialog.geoJsonName = name.replace(/[^a-zA-Z0-9]/g,"_").toLocaleLowerCase(); fileDialog.open(); diff --git a/MapViewPlus/MapDrawingMenu.qml b/MapViewPlus/MapDrawingMenu.qml index a5219a6..fb5b58d 100644 --- a/MapViewPlus/MapDrawingMenu.qml +++ b/MapViewPlus/MapDrawingMenu.qml @@ -41,9 +41,11 @@ Rectangle{ property string activeGeometryType: "" property bool historyAvailable: false property bool bookmarksAvailable: false + property bool geoJsonInMemory: false signal drawingRequest(string g) signal bookmarksRequested() + signal geoJsonFeatureRequested() // UI ////////////////////////////////////////////////////////////////////// @@ -102,6 +104,39 @@ Rectangle{ } } + Rectangle { + Layout.fillHeight: true + Layout.preferredWidth: height + Layout.margins: sf(5) + color: "#fff" + Button { + anchors.fill: parent + enabled: geoJsonInMemory + visible: geoJsonInMemory + ToolTip.text: qsTr("Shapefile or geojson") + ToolTip.visible: hovered + + background: Rectangle { + anchors.fill: parent + color: parent.enabled ? ( parent.pressed ? "#bddbee" : "#fff" ) : "#fff" + border.width: app.info.properties.mainButtonBorderWidth + border.color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" + radius: sf(3) + } + + IconFont { + anchors.centerIn: parent + iconSizeMultiplier: 1.5 + color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" + icon: _icons.geojson + } + + onClicked: { + geoJsonFeatureRequested(); + } + } + } + Rectangle { Layout.fillHeight: true Layout.preferredWidth: sf(1) diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 0002162..e0a51d4 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -28,6 +28,7 @@ import ArcGIS.AppFramework.Sql 1.0 import "../Portal" import "../singletons" as Singletons import "../Controls" as Controls +import "../ProgressIndicator" import "../" //------------------------------------------------------------------------------ @@ -145,6 +146,33 @@ Item { // UI ////////////////////////////////////////////////////////////////////// + Rectangle { + id: busyIndicator + color:"transparent" + anchors.fill: parent + visible: false + z: 10000000 + + Rectangle { + anchors.fill:parent + opacity: .9 + color: Singletons.Colors.subtleBackground + } + + ProgressIndicator { + id: workerScriptProgressIndicator + statusTextFontSize: Singletons.Config.smallFontSizePoint + statusTextMinimumFontSize: 6 + statusTextLeftMargin: sf(10) + iconContainerLeftMargin: sf(5) + iconContainerHeight: this.containerHeight - sf(5) + width: parent.width * .8 + anchors.centerIn: parent + } + } + + // ------------------------------------------------------------------------- + Item { id: topMenu width: ( parent.width < sf(1000) ) ? parent.width - sf(20) : sf(980) @@ -206,8 +234,8 @@ Item { } Item { - Layout.fillWidth: true Layout.fillHeight: true + Layout.preferredWidth: parent.width * .56 MapDrawingMenu { id: drawingMenu @@ -216,6 +244,7 @@ Item { drawingExists: userDrawnExtent historyAvailable: mapViewPlus.historyAvailable && (previewMap.map !== null ? previewMap.map.mapItems.length <= 0 : false) bookmarksAvailable: userBookmarks.count > 0 + geoJsonInMemory: geoJsonHelper.geojson !== null onDrawingRequest: { if (g === Singletons.Constants.kRedraw){ @@ -231,6 +260,9 @@ Item { onBookmarksRequested: { bookmarksPopup.open(); } + onGeoJsonFeatureRequested: { + geoJsonPopup.open(); + } } DropShadow { @@ -269,6 +301,113 @@ Item { clip: true } } + + Popup { + id: geoJsonPopup + width: sf(250) + height: sf(200) + x: topMenu.width - width - topMenu.height + y: topMenu.height + + background: Rectangle { + color: "#fff" + border.color: Singletons.Colors.mediumGray + border.width: sf(1) + } + + ColumnLayout { + anchors.fill: parent + spacing: sf(5) + + Text { + Layout.fillWidth: true + Layout.preferredHeight: sf(40) + text: qsTr("Currently viewing feature %1 of %2".arg(geoJsonHelper.currentFeature).arg(geoJsonHelper.geojson.features.length)) + } + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(50) + RowLayout { + anchors.fill: parent + spacing: sf(5) + Button { + Layout.fillHeight: true + Layout.preferredWidth: height + text: "<" + onClicked: { + + var featureToGet = geoJsonHelper.currentFeature === 0 + ? geoJsonHelper.numberOfFeatures - 1 + : geoJsonHelper.currentFeature - 1; + console.log(featureToGet) + geoJsonHelper.getFeature(featureToGet) + } + } + Text { + Layout.fillHeight: true + Layout.fillWidth: true + anchors.centerIn: parent + text: geoJsonHelper.currentFeature + } + Button { + Layout.fillHeight: true + Layout.preferredWidth: height + text: ">" + onClicked: { + var featureToGet = geoJsonHelper.currentFeature === geoJsonHelper.numberOfFeatures - 1 + ? 0 + : geoJsonHelper.currentFeature + 1; + console.log(featureToGet) + geoJsonHelper.getFeature(featureToGet) + } + } + } + } + + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(30) + TextField { + id: featureToUse + placeholderText: "Enter a specific feature to use" + anchors.fill: parnet + onAccepted: { + geoJsonHelper.getFeature(parseInt(text, 10)); + } + } + } + + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(30) + Button { + anchors.fill: parent + text: "Save geojson" + onClicked: { + geoJsonHelper.saveGeoJsonToFile(geoJsonHelper.geojson, "geojson%1".arg(Date.now())) + //geoJsonHelper.saveGeojsonToFile() + } + } + } + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(30) + Button { + anchors.fill: parent + text: "Clear geojson" + onClicked: { + geoJsonHelper.geojson = null; + geoJsonPopup.close(); + } + } + + } + + Item { + Layout.fillHeight: true + } + } + } } Rectangle { @@ -411,6 +550,8 @@ Item { z: previewMap.z + 3 } + + //-------------------------------------------------------------------------- DropArea { @@ -486,7 +627,10 @@ Item { } if (shapeFilePath !== "") { - + busyIndicator.visible = true; + workerScriptProgressIndicator.show(); + workerScriptProgressIndicator.progressIcon = workerScriptProgressIndicator.working; + workerScriptProgressIndicator.progressText = qsTr("Reading shapefile.."); workerScript.sendMessage({"path": shapeFilePath, "coordinate_system": coordinateSystem}); } } @@ -874,7 +1018,9 @@ Item { if (AppFramework.clipboard.dataAvailable) { try { var json = JSON.parse(AppFramework.clipboard.text) - geoJsonHelper.parseGeometry(json); + //geoJsonHelper.parseGeometry(json); + geoJsonHelper.setGeoJson(json); + geoJsonHelper.getFeature(0); } catch(e) { console.log("not json") @@ -1277,7 +1423,7 @@ Item { } onClicked: { - geoJsonHelper.saveGeojsonToFile(JSON.parse(geojson), name); + geoJsonHelper.saveGeoJsonToFile(JSON.parse(geojson), name); } } Button { @@ -1318,13 +1464,19 @@ Item { onMessage: { if (messageObject.hasOwnProperty("geojson")){ - geoJsonHelper.parseGeometry(messageObject.geojson); - // messageObject.geojson; + workerScriptProgressIndicator.progressIcon = workerScriptProgressIndicator.success + workerScriptProgressIndicator.progressText = qsTr("Shapefile successfully read and converted to geojson.") + geoJsonHelper.setGeoJson(messageObject.geojson); + busyIndicator.visible = false; + geoJsonHelper.getFeature(0); } if (messageObject.hasOwnProperty("error")){ drawingError("Error: %1".arg(messageObject.error.message)); // messageObject.error.message } + if (messageObject.hasOwnProperty("status")){ + workerScriptProgressIndicator.progressText = messageObject.status; + } } } diff --git a/MapViewPlus/shapeFileToGeoJSON.js b/MapViewPlus/shapeFileToGeoJSON.js index a790f02..5d6ac87 100644 --- a/MapViewPlus/shapeFileToGeoJSON.js +++ b/MapViewPlus/shapeFileToGeoJSON.js @@ -2,6 +2,27 @@ // An Esri White Paper -- July 1998 // https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf +var shpDataArray = null; +var shapeType = null; +var shapeValue = -1; +var shapeFileByteLength = 0; +var partsArray = []; +var pointsArray = []; +var cursor = 0; +var featureCount = 1; + +var geoJson = { + "type": "FeatureCollection", + "crs": { + "type" : "name", + "properties" : { + "name" : "" + } + }, + "bbox": [], + "shapefile_related": {}, + "features": [] +}; WorkerScript.onMessage = function(shapeFile) { @@ -24,11 +45,32 @@ WorkerScript.onMessage = function(shapeFile) { xhr.responseType = "arraybuffer"; xhr.open("GET", shapeFile.path, true); xhr.send(); - } -var partsArray = []; -var pointsArray = []; +function establishSpatialReference(minx, miny, maxx, maxy){ + console.log("establishSpatialReference") + + // the shape file .prj file was other than 3857 or 4326, so attempt + // to see if it is lat / lon or web mercator type values. + + // its highly unlikely a web mercator projection will fall within + // the following parameters, + + if (minx > 180 + || minx < -180 + || maxx > 180 + || maxx < -180 + || miny > 90 + || miny < -90 + || maxy > 90 + || maxy < -90) { + + return "3857"; + } + else { + return "4326"; + } +} var shapeTypes = []; shapeTypes[0] = {"esri": "Null Shape", "geojson": null}; @@ -109,38 +151,32 @@ var shpHeader = { } } -var geoJson = { - "type": "FeatureCollection", - "crs": { - "type" : "name", - "properties" : { - "name" : "" - } - }, - "features": [] -}; - - function getShapeType(val){ return shapeTypes[val]; } function resetFeatures(){ + shpDataArray = null; + shapeFileByteLength = 0; + shapeType = null; + shapeValue = -1; geoJson.features = []; + cursor = 0; partsArray = []; pointsArray = []; + featureCount = 1; } function shapefileByteArrayToGeoJson(byteArray) { resetFeatures(); - var geoJsonFeature = {}; + shpDataArray = new DataView(byteArray); - var shpDataArray = new DataView(byteArray); + shapeFileByteLength = shpDataArray.byteLength; // A byteLength less than 101 means there is no geometry.------------------- - if (shpDataArray.byteLength < 101){ + if (shapeFileByteLength < 101){ try { throw new Error("This shapefile contains no geometry"); } @@ -152,7 +188,10 @@ function shapefileByteArrayToGeoJson(byteArray) { } } - var shapeValue = shpDataArray.getInt32(shpHeader.shape_type.position, shpHeader.shape_type.bigEndian); + shapeValue = shpDataArray.getInt32(shpHeader.shape_type.position, shpHeader.shape_type.bigEndian); + + geoJson["shapefile_related"]["byteLength"] = shapeFileByteLength; + geoJson["shapefile_related"]["shapeType"] = shapeValue; // only supporting MultilineString, Polygon -------------------------------- if (shapeValue !== 3 && shapeValue !== 5) { @@ -168,166 +207,171 @@ function shapefileByteArrayToGeoJson(byteArray) { } } - var shapeType = shapeTypes[shapeValue]; + var boundingBoxXMin = shpDataArray.getFloat64(shpHeader.xmin.position, shpHeader.xmin.bigEndian); + geoJson["bbox"][0] = boundingBoxXMin; - if (shapeType !== undefined && shapeType !== null && shapeType !== 0 && shapeType.geojson !== null) { + var boundingBoxYMin = shpDataArray.getFloat64(shpHeader.ymin.position, shpHeader.ymin.bigEndian); + geoJson["bbox"][1] = boundingBoxYMin; + + var boundingBoxXMax = shpDataArray.getFloat64(shpHeader.xmax.position, shpHeader.xmax.bigEndian); + geoJson["bbox"][2] = boundingBoxXMax; + + var boundingBoxYMax = shpDataArray.getFloat64(shpHeader.ymax.position, shpHeader.ymax.bigEndian); + geoJson["bbox"][3] = boundingBoxYMax; - geoJsonFeature["type"] = "Feature"; - geoJsonFeature["properties"] = {}; - geoJsonFeature["bbox"] = []; - geoJsonFeature["shapefile_related"] = {}; - geoJsonFeature["geometry"] = { - "type": shapeType.geojson, - "coordinates": [] + if (geoJson["crs"]["properties"]["name"] === "") { + geoJson["crs"]["properties"]["name"] = establishSpatialReference(boundingBoxXMin, boundingBoxXMin, boundingBoxXMax, boundingBoxYMax); + } + + shapeType = shapeTypes[shapeValue]; + + // geometry entries start at 100 after shape file header ------------------- + cursor = 100; + + if (shapeType !== undefined && shapeType !== null && shapeType !== 0 && shapeType.geojson !== null) { + while (cursor < shapeFileByteLength) { + var feature = getFeature(cursor); + geoJson.features.push(feature); } + } + + console.log(JSON.stringify(geoJson)); -// if (shapeValue === 5){ -// geoJsonFeature["geometry"]["coordinates"][0] = []; -// } + WorkerScript.sendMessage({"geojson": geoJson}); - var boundingBoxXMin = shpDataArray.getFloat64(shpHeader.xmin.position, shpHeader.xmin.bigEndian); - geoJsonFeature["bbox"][0] = boundingBoxXMin; + return geoJson; - var boundingBoxYMin = shpDataArray.getFloat64(shpHeader.ymin.position, shpHeader.ymin.bigEndian); - geoJsonFeature["bbox"][1] = boundingBoxYMin; +} - var boundingBoxXMax = shpDataArray.getFloat64(shpHeader.xmax.position, shpHeader.xmax.bigEndian); - geoJsonFeature["bbox"][2] = boundingBoxXMax; +function getFeature(thisCursor){ - var boundingBoxYMax = shpDataArray.getFloat64(shpHeader.ymax.position, shpHeader.ymax.bigEndian); - geoJsonFeature["bbox"][3] = boundingBoxYMax; + console.log("getFeature: ", thisCursor); - if (geoJson["crs"]["properties"]["name"] === "") { - geoJson["crs"]["properties"]["name"] = establishSpatialReference(boundingBoxXMin, boundingBoxXMin, boundingBoxXMax, boundingBoxYMax); - } + var currentFeature = {}; + partsArray = []; + pointsArray = []; - geoJsonFeature["shapefile_related"]["RecordNumber"] = shpDataArray.getInt32(100); - geoJsonFeature["shapefile_related"]["Content Length"] = shpDataArray.getInt32(104); - geoJsonFeature["shapefile_related"]["ShapeType"] = shpDataArray.getInt32(108, true); - geoJsonFeature["shapefile_related"]["box"] = [shpDataArray.getFloat64(112, true), shpDataArray.getFloat64(120, true), shpDataArray.getFloat64(128, true), shpDataArray.getFloat64(136, true)]; - geoJsonFeature["shapefile_related"]["numParts"] = shpDataArray.getInt32(144, true); - geoJsonFeature["shapefile_related"]["numPoints"] = shpDataArray.getInt32(148, true); -// geoJsonFeature["shapefile_related"]["Parts"] = shpDataArray.getInt32(152, true); -// geoJsonFeature["shapefile_related"]["X"] = (152 + 4 * geoJsonFeature["shapefile_related"]["numParts"]); - - console.log(JSON.stringify(geoJsonFeature)); - - // over 100 parts? then not gonna process currently ----------------- - if (geoJsonFeature["shapefile_related"]["numParts"] > 100) { - try { - throw new Error("This tool only supports shapefiles with less than 100 parts."); - } - catch(e) { - WorkerScript.sendMessage({"error": e}); - } - finally { - return; - } + currentFeature["type"] = "Feature"; + currentFeature["bbox"] = []; + currentFeature["properties"] = {}; + currentFeature["shapefile_related"] = {}; + currentFeature["geometry"] = { + "type": shapeType.geojson, + "coordinates": [] + } + + console.log(JSON.stringify(currentFeature)); + + currentFeature["properties"]["RecordNumber"] = shpDataArray.getInt32(thisCursor); + thisCursor += 4; + currentFeature["shapefile_related"]["Content Length"] = shpDataArray.getInt32(thisCursor); + thisCursor += 4; + currentFeature["shapefile_related"]["ShapeType"] = shpDataArray.getInt32(108, true); + thisCursor += 4; + currentFeature["bbox"] = [] + currentFeature["bbox"][0] = shpDataArray.getFloat64(thisCursor, true); + thisCursor += 8; + currentFeature["bbox"][1] = shpDataArray.getFloat64(thisCursor, true); + thisCursor += 8; + currentFeature["bbox"][2] = shpDataArray.getFloat64(thisCursor, true); + thisCursor += 8; + currentFeature["bbox"][3] = shpDataArray.getFloat64(thisCursor, true); + thisCursor += 8; + currentFeature["shapefile_related"]["numParts"] = shpDataArray.getInt32(thisCursor, true); + thisCursor += 4; + currentFeature["shapefile_related"]["numPoints"] = shpDataArray.getInt32(thisCursor, true); + thisCursor += 4; + + + if (currentFeature["shapefile_related"]["numParts"] > 500) { + try { + throw new Error("This tool only supports shapefiles with less than 500 parts."); + } + catch(e) { + WorkerScript.sendMessage({"error": e}); } + finally { + return; + } + } - if (geoJsonFeature["shapefile_related"]["numParts"] > 0) { + if (currentFeature["shapefile_related"]["numParts"] > 0) { - try { - var cursor = 152, x = 0; - for (x = 0; x < geoJsonFeature["shapefile_related"]["numParts"]; x++) { - var pointLocation = shpDataArray.getInt32(cursor, true); - partsArray.push(pointLocation); - cursor += 4; - } + try { - console.log("partsArray.length: ", partsArray.length); + WorkerScript.sendMessage({"status": qsTr("Reading %1 features.".arg(featureCount))}); - var nP = geoJsonFeature["shapefile_related"]["numPoints"] * 2; + var x = 0; - for (x = 0; x < nP; x++) { - var point = shpDataArray.getFloat64(cursor, true); - pointsArray.push(point); - cursor += 8; - } + for (x = 0; x < currentFeature["shapefile_related"]["numParts"]; x++) { + var pointLocation = shpDataArray.getInt32(thisCursor, true); + partsArray.push(pointLocation); + thisCursor += 4; + } - console.log("pointsArray.length: ", pointsArray.length); + console.log("partsArray.length: ", partsArray.length); - for (x = 0; x < partsArray.length; x++) { + var nP = currentFeature["shapefile_related"]["numPoints"] * 2; - if (shapeValue === 5) { - geoJsonFeature["geometry"].coordinates[x] = []; - } + for (x = 0; x < nP; x++) { + var point = shpDataArray.getFloat64(thisCursor, true); + pointsArray.push(point); + thisCursor += 8; + } + +// console.log("pointsArray.length: ", pointsArray.length); + + for (x = 0; x < partsArray.length; x++) { - var pointStart = partsArray[x] * 2; // e.g. [0,320,333] + if (shapeValue === 5) { + currentFeature["geometry"].coordinates[x] = []; + } - console.log("--------------------- x: ", x) - console.log("pointStart: ", pointStart); + var pointStart = partsArray[x] * 2; // e.g. [0,320,333] - var lastPoint = (x === partsArray.length - 1) ? pointsArray.length : partsArray[x+1] * 2; - console.log("lastPoint: ", lastPoint) +// console.log("pointStart: ", pointStart); - var numberOfPoints = lastPoint - pointStart; - console.log("numberOfPoints: ", numberOfPoints) + var lastPoint = (x === partsArray.length - 1) ? pointsArray.length : partsArray[x+1] * 2; +// console.log("lastPoint: ", lastPoint) - var coordinate = []; + var coordinate = []; - for (var pointCounter = pointStart; pointCounter < lastPoint; pointCounter++) { - // 0 : 0 --> pointsArray[0] to pointsArray[319] - // 1 : pointsArray[320] -> - console.log("step: %1, pointCounter: %2, coord:%3, cLength:%4".arg(x).arg(pointCounter).arg(pointsArray[pointCounter]).arg(geoJsonFeature["geometry"].coordinates[x].length)); + for (var pointCounter = pointStart; pointCounter < lastPoint; pointCounter++) { +// console.log("step: %1, pointCounter: %2, coord:%3, cLength:%4".arg(x).arg(pointCounter).arg(pointsArray[pointCounter]).arg(currentFeature["geometry"].coordinates[x].length)); - coordinate.push(pointsArray[pointCounter]); + coordinate.push(pointsArray[pointCounter]); - if (coordinate.length === 2) { + if (coordinate.length === 2) { - if (shapeValue === 5) { - geoJsonFeature["geometry"].coordinates[x].push(coordinate); - } - else if (shapeValue === 3) { - geoJsonFeature["geometry"].coordinates.push(coordinate); - } - else { + if (shapeValue === 5) { + currentFeature["geometry"].coordinates[x].push(coordinate); + } + else if (shapeValue === 3) { + currentFeature["geometry"].coordinates.push(coordinate); + } + else { - } - coordinate = []; } + coordinate = []; } } } - catch(e) { - WorkerScript.sendMessage({"error": e}); - } + featureCount ++; + } + catch(e) { + WorkerScript.sendMessage({"error": e}); } } - geoJson.features.push(geoJsonFeature); - - console.log(JSON.stringify(geoJson)); - - WorkerScript.sendMessage({"geojson": geoJson}); - - return geoJson; +// console.log("currentFeature: ", JSON.stringify(currentFeature)); -} + // Set global cursor so next feature can be read by while loop ------------- + cursor = thisCursor; -function establishSpatialReference(minx, miny, maxx, maxy){ - console.log("establishSpatialReference") +// console.log("cursor: ", cursor) - // the shape file .prj file was other than 3857 or 4326, so attempt - // to see if it is lat / lon or web mercator type values. + return currentFeature; - // its highly unlikely a web mercator projection will fall within - // the following parameters, - - if (minx > 180 - || minx < -180 - || maxx > 180 - || maxx < -180 - || miny > 90 - || miny < -90 - || maxy > 90 - || maxy < -90) { - - return "3857"; - } - else { - return "4326"; - } } diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index 135c226..b70e03f 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -1,4 +1,4 @@ -/* Copyright 2017 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,6 +133,7 @@ App { property string draw_path: useIconFont ? "y" : "images/draw-path.svg" property string draw_polygon: useIconFont ? "D" : "images/draw-polygon.svg" property string draw_tool: useIconFont ? "F" : "images/draw-tool.svg" + property string geojson: useIconFont ? "H" : "images/geojson.svg" property string happy_face: useIconFont ? "x" : "images/happy.svg" property string history: useIconFont ? "f" : "images/history.svg" property string info: useIconFont ? "r" : "images/info.svg" diff --git a/fonts/tilepackage.svg b/fonts/tilepackage.svg index 972ef61..c4a395d 100644 --- a/fonts/tilepackage.svg +++ b/fonts/tilepackage.svg @@ -40,4 +40,5 @@ + diff --git a/fonts/tilepackage.ttf b/fonts/tilepackage.ttf index deec55685f6ee9a45f9e77fc355862127ecee3df..42d004509146aecb0a3a5111fad6f0d5083cc90a 100644 GIT binary patch delta 1624 zcmah}U1(cn82;YxKWUq!F6Sg}O`GO)NkO)5`8$ExR@8L`TRQ6xyBKJkwWYLcr0eLe zGQ>-TVZcirqN1>iVPykvwhK|g8?Pn>k)oo4Hxp4RXzTN(Sz#Ay&Ua3}_j`Yy=Xu}5 zd3EfEQ%y#Uu^x7r33hs7;_2y2yU%>WSnvf-`%XQ6a)Qk=4f_Mw*_o$CiZfehZ!tz^ zU_X0qx!$>~dY{u=D; z`TFwQ%~!5n!*&5@HySIe7slWIYk;v_7WQT4#Ni%JC+U%>Sc<+RtE^h<-qYNfYa@KZs>KadOtbFfa3mpnnL z9G1ta8di%bKjoLaq)EmpMnNuLDCb8hALfIc(O$CTmx=>TYDalS8y)1Z0220-2VYnn zr*Z+oSR<6Ll*4K`Mq#z&GD5FhtrV;6%fTf53kJPnrBunQmXHz_v0Plr z2On)>3!Ny0oy2gIN?rj39XBr-Bd=XO1?C3fds-2@ zj}LbTKTP>W=*(9Ti-i^y?w2}1PB^Z;^p1dbyWBtu`TO}B9hSUuSah=8vxB+co_wX< zAJ-oG(gw{$u0OGzNT(CjNTko0{%P+CyK}|b?L=eeJ(9$UYfch>f^#k;$M#9BB?&=_ z3t>nKY>k%OQdAk)LrO};iAZq86-lXuK$an4qsodvz#-x47D`al=R%_nrM$5uKsa7I z!L3mmnJ7<&%ZOFnq&(#|QW|Zecm9RgBVee6uqaF%56=CA67}6y7$nbVBid3NGenA} zgOD2BBPt?$w1@(<&6|S(oPc)3rIlSmb7hT*Xe*&wk})tN3Zvk{zsJr3;iLzR0O!b- z5qNnDHK3CF^m=#Ufd{>GV&`CIZAW(KF@JB!xRb=yd+gP%n6@Z;bOLD-;@W1V-s zfgi0ml(AlT**TfeYh?CxixPC#5Y!VR(9vwT@{g zO`LT;Oxm#)3N;{34S)*9Cj?$3(6U-948gr*%An~TUMiAx!)jNTLK@!D=UR`Ybg*&d zP%lxf^-kZ2tsN;HDIPmsYYk@dt=+ywI^0^!OmfO@e3a=XYv$)x7FSo!w{G`m@Rj_w M|4`Td7j<*(ALfYC(EtDd delta 355 zcmaFj-eOnJz{tSBz{}9Uz|0Wf<`&{x`E#xs1B2WPps0+yi>n($AOjnae*(x?@DJ8E z@_!JspMilf0>}?b&P^=X@V%9ffq@CgWeiGBEH3!}A7~PT+yS5fM|w_Wn%&I)`3wxq z3m6#0KV+mPrtsaf_5;e@0b;X^jMVx>78Az5K+PgR0hNs0k_xs9jK_fd4M2WCPJVJ? z*0!WJpaCI3zE^HyMFB%D(@&th1(2_hmzbNny>87K1_tQ~K(TEF`Nbvbv1fqlWj%oW zGO*`>9xTmk*%r@l^Ob=cfodi%P?lv> Op1e<4nj3ETUu^(CabJW0 diff --git a/images/geojson.svg b/images/geojson.svg new file mode 100644 index 0000000..f6f37d0 --- /dev/null +++ b/images/geojson.svg @@ -0,0 +1,53 @@ + + + +file-empty + + + + + + + + + + + + + From 68c8b0bb340ce11dc64e08261aa503a77c041900 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 28 Mar 2018 16:58:14 +1100 Subject: [PATCH 06/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appinfo.json b/appinfo.json index d0eb8c1..fe508eb 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 2, + "micro": 3, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 69920fc..e96ed19 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,9 +24,9 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522043047000, + "modified": 1522216664000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 40, + "numComments": 41, "numRatings": 0, "numViews": 240, "owner": "appstudio_apps", @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 851713, + "size": 856475, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 1f86c6c9159b170df72e2ccc2c6c430c49aca81e Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 29 Mar 2018 13:40:46 +1100 Subject: [PATCH 07/29] #60 Imported shape file or geojson panel UI/UX improved. --- MapViewPlus/GeoJsonHelper.qml | 5 +- MapViewPlus/MapDrawingMenu.qml | 19 +- MapViewPlus/MapViewPlus.qml | 406 +++++++++++++++++++++++++++------ singletons/Strings.qml | 7 + 4 files changed, 355 insertions(+), 82 deletions(-) diff --git a/MapViewPlus/GeoJsonHelper.qml b/MapViewPlus/GeoJsonHelper.qml index 554de8b..7b589ab 100644 --- a/MapViewPlus/GeoJsonHelper.qml +++ b/MapViewPlus/GeoJsonHelper.qml @@ -78,6 +78,9 @@ Item{ if (feature === undefined || feature < 0 || feature > geojson.features.length){ feature = 0; } + + currentFeature = feature; + _normalize(feature); } @@ -89,8 +92,6 @@ Item{ return; } - currentFeature = feature; - var features; var isWebMercator = false; diff --git a/MapViewPlus/MapDrawingMenu.qml b/MapViewPlus/MapDrawingMenu.qml index fb5b58d..214cc0c 100644 --- a/MapViewPlus/MapDrawingMenu.qml +++ b/MapViewPlus/MapDrawingMenu.qml @@ -41,7 +41,9 @@ Rectangle{ property string activeGeometryType: "" property bool historyAvailable: false property bool bookmarksAvailable: false + property bool bookmarksPopupOpen: false property bool geoJsonInMemory: false + property bool geoJsonPopupOpen: false signal drawingRequest(string g) signal bookmarksRequested() @@ -110,15 +112,16 @@ Rectangle{ Layout.margins: sf(5) color: "#fff" Button { + id: geojsonBtn anchors.fill: parent enabled: geoJsonInMemory visible: geoJsonInMemory - ToolTip.text: qsTr("Shapefile or geojson") + ToolTip.text: qsTr("Shapefile or geojson data") ToolTip.visible: hovered background: Rectangle { anchors.fill: parent - color: parent.enabled ? ( parent.pressed ? "#bddbee" : "#fff" ) : "#fff" + color: geoJsonPopupOpen ? app.info.properties.mainButtonBorderColor : "#fff" border.width: app.info.properties.mainButtonBorderWidth border.color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" radius: sf(3) @@ -127,7 +130,9 @@ Rectangle{ IconFont { anchors.centerIn: parent iconSizeMultiplier: 1.5 - color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" + color: parent.enabled + ? geoJsonPopupOpen ? "#fff" : app.info.properties.mainButtonBorderColor + : "#ddd" icon: _icons.geojson } @@ -157,7 +162,9 @@ Rectangle{ background: Rectangle { anchors.fill: parent - color: parent.enabled ? ( parent.pressed ? "#bddbee" : "#fff" ) : "#fff" + color: parent.enabled + ? bookmarksPopupOpen ? app.info.properties.mainButtonBorderColor : ( parent.pressed ? "#bddbee" : "#fff" ) + : "#fff" border.width: app.info.properties.mainButtonBorderWidth border.color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" radius: sf(3) @@ -166,7 +173,9 @@ Rectangle{ IconFont { anchors.centerIn: parent iconSizeMultiplier: 1.5 - color: parent.enabled ? app.info.properties.mainButtonBorderColor : "#ddd" + color: parent.enabled + ? bookmarksPopupOpen ? "#fff" : app.info.properties.mainButtonBorderColor + : "#ddd" icon: _icons.bookmark } diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index e0a51d4..2d48191 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -14,9 +14,9 @@ * */ -import QtQuick 2.6 -import QtQuick.Controls 2.1 -import QtQuick.Layouts 1.1 +import QtQuick 2.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 import QtLocation 5.3 import QtPositioning 5.3 import QtGraphicalEffects 1.0 @@ -244,7 +244,9 @@ Item { drawingExists: userDrawnExtent historyAvailable: mapViewPlus.historyAvailable && (previewMap.map !== null ? previewMap.map.mapItems.length <= 0 : false) bookmarksAvailable: userBookmarks.count > 0 + bookmarksPopupOpen: bookmarksPopup.visible geoJsonInMemory: geoJsonHelper.geojson !== null + geoJsonPopupOpen: geoJsonPopup.visible onDrawingRequest: { if (g === Singletons.Constants.kRedraw){ @@ -262,6 +264,9 @@ Item { } onGeoJsonFeatureRequested: { geoJsonPopup.open(); + if (previewMap.map.mapItems.length === 0 ) { + geoJsonHelper.getFeature(0); + } } } @@ -304,10 +309,11 @@ Item { Popup { id: geoJsonPopup - width: sf(250) - height: sf(200) - x: topMenu.width - width - topMenu.height + width: sf(315) + height: sf(96) + x: topMenu.width - width y: topMenu.height + padding: 0 background: Rectangle { color: "#fff" @@ -315,96 +321,331 @@ Item { border.width: sf(1) } - ColumnLayout { + RowLayout { anchors.fill: parent + anchors.margins: sf(5) spacing: sf(5) - Text { - Layout.fillWidth: true - Layout.preferredHeight: sf(40) - text: qsTr("Currently viewing feature %1 of %2".arg(geoJsonHelper.currentFeature).arg(geoJsonHelper.geojson.features.length)) - } Item { Layout.fillWidth: true - Layout.preferredHeight: sf(50) - RowLayout { + Layout.fillHeight: true + + ColumnLayout { anchors.fill: parent - spacing: sf(5) - Button { - Layout.fillHeight: true - Layout.preferredWidth: height - text: "<" - onClicked: { + spacing: 0 - var featureToGet = geoJsonHelper.currentFeature === 0 - ? geoJsonHelper.numberOfFeatures - 1 - : geoJsonHelper.currentFeature - 1; - console.log(featureToGet) - geoJsonHelper.getFeature(featureToGet) + Item { + Layout.preferredHeight: sf(40) + Layout.topMargin: sf(15) + Layout.fillWidth: true + Accessible.role: Accessible.Pane + + RowLayout { + anchors.fill: parent + spacing: 0 + + Item { + Layout.fillHeight: true + Layout.preferredWidth: height + Accessible.role: Accessible.Pane + + Button { + anchors.fill: parent + + ToolTip.visible: hovered + ToolTip.text: Singletons.Strings.selectPreviousFeature + + background: Rectangle{ + color: "transparent" + anchors.fill: parent + } + + IconFont { + anchors.centerIn: parent + icon: _icons.chevron_left + iconSizeMultiplier: 1 + color: parent.enabled ? Singletons.Colors.mainButtonBackgroundColor : Singletons.Colors.mediumGray + Accessible.ignored: true + } + + onClicked: { + var featureToGet = geoJsonHelper.currentFeature === 0 + ? geoJsonHelper.numberOfFeatures - 1 + : geoJsonHelper.currentFeature - 1; + geoJsonHelper.getFeature(featureToGet); + } + + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.selectPreviousFeature + Accessible.description: Singletons.Strings.selectPreviousFeature + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } + } + } + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + Accessible.role: Accessible.Pane + + Controls.StyledTextField { + id: featureToUse + ToolTip.visible: hovered + ToolTip.text: Singletons.Strings.enterASpecificFeature + placeholderText: Singletons.Strings.enterASpecificFeature + anchors.fill: parent + text: "1" + horizontalAlignment: Text.AlignHCenter + leftPadding: 0 + rightPadding: 0 + font.pointSize: Singletons.Config.mediumFontSizePoint + onAccepted: { + var enteredNumber; + + if (!text.match(/^\d+$/)) { + enteredNumber = 1; + } + else { + enteredNumber = parseInt(text, 10); + } + + if (enteredNumber < 0 || enteredNumber === 0) { + enteredNumber = 1; + } + + if (enteredNumber > geoJsonHelper.numberOfFeatures) { + enteredNumber = geoJsonHelper.numberOfFeatures; + } + + enteredNumber--; + + geoJsonHelper.getFeature(enteredNumber); + } + Accessible.name: placeholderText + + Connections { + target: geoJsonHelper + onCurrentFeatureChanged: { + featureToUse.text = geoJsonHelper.currentFeature + 1; + } + } + } + } + + Item { + Layout.fillHeight: true + Layout.preferredWidth: height + Accessible.role: Accessible.Pane + + Button { + anchors.fill: parent + + ToolTip.visible: hovered + ToolTip.text: Singletons.Strings.selectNextFeature + + background: Rectangle{ + color: "transparent" + anchors.fill: parent + } + + IconFont { + anchors.centerIn: parent + icon: _icons.chevron_right + iconSizeMultiplier: 1 + color: parent.enabled ? Singletons.Colors.mainButtonBackgroundColor : Singletons.Colors.mediumGray + Accessible.ignored: true + } + + onClicked: { + var featureToGet = geoJsonHelper.currentFeature === geoJsonHelper.numberOfFeatures - 1 + ? 0 + : geoJsonHelper.currentFeature + 1; + console.log(featureToGet) + geoJsonHelper.getFeature(featureToGet); + } + + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.selectNextFeature + Accessible.description: Singletons.Strings.selectNextFeature + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } + } + } } } - Text { - Layout.fillHeight: true + + Item { Layout.fillWidth: true - anchors.centerIn: parent - text: geoJsonHelper.currentFeature - } - Button { Layout.fillHeight: true - Layout.preferredWidth: height - text: ">" - onClicked: { - var featureToGet = geoJsonHelper.currentFeature === geoJsonHelper.numberOfFeatures - 1 - ? 0 - : geoJsonHelper.currentFeature + 1; - console.log(featureToGet) - geoJsonHelper.getFeature(featureToGet) + Accessible.role: Accessible.Pane + + Text { + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: Singletons.Strings.viewingFeatureXofX.arg(geoJsonHelper.currentFeature + 1).arg(geoJsonHelper.numberOfFeatures) + color: Singletons.Colors.darkGray + font.pointSize: Singletons.Config.xSmallFontSizePoint + font.family: notoRegular + wrapMode: Text.Wrap } } } + + Accessible.role: Accessible.Pane } - Item { - Layout.fillWidth: true - Layout.preferredHeight: sf(30) - TextField { - id: featureToUse - placeholderText: "Enter a specific feature to use" - anchors.fill: parnet - onAccepted: { - geoJsonHelper.getFeature(parseInt(text, 10)); - } - } + Rectangle { + Layout.fillHeight: true + Layout.preferredWidth: sf(1) + color: Singletons.Colors.formElementBorderColor + Accessible.role: Accessible.Separator } Item { Layout.fillWidth: true - Layout.preferredHeight: sf(30) - Button { + Layout.fillHeight: true + Accessible.role: Accessible.Pane + + ColumnLayout { anchors.fill: parent - text: "Save geojson" - onClicked: { - geoJsonHelper.saveGeoJsonToFile(geoJsonHelper.geojson, "geojson%1".arg(Date.now())) - //geoJsonHelper.saveGeojsonToFile() + spacing: sf(6) + Item { + Layout.fillHeight: true + Accessible.ignored: true } - } - } - Item { - Layout.fillWidth: true - Layout.preferredHeight: sf(30) - Button { - anchors.fill: parent - text: "Clear geojson" - onClicked: { - geoJsonHelper.geojson = null; - geoJsonPopup.close(); + Button { + Layout.preferredHeight: sf(30) + Layout.fillWidth: true + ToolTip.text: Singletons.Strings.saveAsGeojson + ToolTip.visible: hovered + + background: Rectangle { + anchors.fill: parent + color: Singletons.Config.buttonStates(parent, "clear") + radius: sf(4) + border.width: parent.enabled ? app.info.properties.mainButtonBorderWidth : 0 + border.color: app.info.properties.mainButtonBorderColor + } + RowLayout { + anchors.fill: parent + spacing: 0 + Item { + Layout.fillHeight: true + Layout.fillWidth: true + Layout.leftMargin: sf(10) + Accessible.role: Accessible.Pane + + Text { + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + text: Singletons.Strings.saveAsGeojson + font.family: notoRegular + font.pointSize: Singletons.Config.smallFontSizePoint + elide: Text.ElideRight + color: app.info.properties.mainButtonBorderColor + } + } + Item { + Layout.fillHeight: true + Layout.preferredWidth: height + Accessible.role: Accessible.Pane + + IconFont { + anchors.centerIn: parent + icon: _icons.download + iconSizeMultiplier: .8 + color: app.info.properties.mainButtonBorderColor + } + } + } + + onClicked: { + geoJsonHelper.saveGeoJsonToFile(geoJsonHelper.geojson, "geojson%1".arg(Date.now())); + } + + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.saveAsGeojson + Accessible.description: Singletons.Strings.saveAsGeojson + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } } - } - } + Button { + Layout.preferredHeight: sf(30) + Layout.fillWidth: true + ToolTip.text: Singletons.Strings.clearAllData + ToolTip.visible: hovered - Item { - Layout.fillHeight: true + background: Rectangle { + anchors.fill: parent + color: Singletons.Config.buttonStates(parent, "clear") + radius: sf(4) + border.width: parent.enabled ? app.info.properties.mainButtonBorderWidth : 0 + border.color: "red" + } + + RowLayout { + anchors.fill: parent + spacing: 0 + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + Layout.leftMargin: sf(10) + Accessible.role: Accessible.Pane + + Text { + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + text: Singletons.Strings.clearAllData + font.family: notoRegular + font.pointSize: Singletons.Config.smallFontSizePoint + elide: Text.ElideRight + color: "red" + } + } + + Item { + Layout.fillHeight: true + Layout.preferredWidth: height + Accessible.role: Accessible.Pane + + IconFont { + anchors.centerIn: parent + icon: _icons.trash_bin + iconSizeMultiplier: .8 + color: "red" + } + } + } + onClicked: { + geoJsonHelper.geojson = null; + geoJsonPopup.close(); + } + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.clearAllData + Accessible.description: Singletons.Strings.clearAllData + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } + } + Item { + Layout.fillHeight: true + Accessible.ignored: true + } + } } } } @@ -1405,7 +1646,7 @@ Item { Button { Layout.fillHeight: true Layout.preferredWidth: height - ToolTip.text: qsTr("Download as geojson") + ToolTip.text: Singletons.Strings.saveAsGeojson ToolTip.visible: hovered background: Rectangle { anchors.fill: parent @@ -1425,6 +1666,14 @@ Item { onClicked: { geoJsonHelper.saveGeoJsonToFile(JSON.parse(geojson), name); } + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.saveAsGeojson + Accessible.description: Singletons.Strings.saveAsGeojson + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } } Button { Layout.fillHeight: true @@ -1451,6 +1700,14 @@ Item { appDatabase.write(sql); _loadBookmarks(); } + Accessible.role: Accessible.Button + Accessible.name: Singletons.Strings.deleteBookmark + Accessible.description: Singletons.Strings.deleteBookmark + Accessible.onPressAction: { + if (enabled && visible) { + clicked(); + } + } } } } @@ -1465,14 +1722,14 @@ Item { onMessage: { if (messageObject.hasOwnProperty("geojson")){ workerScriptProgressIndicator.progressIcon = workerScriptProgressIndicator.success - workerScriptProgressIndicator.progressText = qsTr("Shapefile successfully read and converted to geojson.") + workerScriptProgressIndicator.progressText = Singletons.Strings.shapefileSuccessfullyImported geoJsonHelper.setGeoJson(messageObject.geojson); busyIndicator.visible = false; geoJsonHelper.getFeature(0); + geoJsonPopup.open(); } if (messageObject.hasOwnProperty("error")){ drawingError("Error: %1".arg(messageObject.error.message)); - // messageObject.error.message } if (messageObject.hasOwnProperty("status")){ workerScriptProgressIndicator.progressText = messageObject.status; @@ -1483,7 +1740,6 @@ Item { // METHODS ///////////////////////////////////////////////////////////////// function getCurrentGeometry(){ - console.log("----------------getCurrentGeometry():", geometryType); var g; if (drawMultipath) { g = getMutlipathGeometry(); diff --git a/singletons/Strings.qml b/singletons/Strings.qml index 0623c14..c93d8cd 100644 --- a/singletons/Strings.qml +++ b/singletons/Strings.qml @@ -49,6 +49,7 @@ QtObject { readonly property string cancel: qsTr("Cancel") readonly property string cancelling: qsTr("Cancelling") readonly property string cancellingUpload: qsTr("Cancelling Upload.") + readonly property string clearAllData: qsTr("Clear all data") readonly property string contextMenuDesc: qsTr("Context menu for this service.") readonly property string checkingSpatialReference: qsTr("Checking Spatial Reference") readonly property string create: qsTr("Create") @@ -88,6 +89,7 @@ QtObject { // E ----------------------------------------------------------------------- readonly property string enableAllZoomLevels: qsTr("Enable zoom levels greater than 21.
NOTE: Exports often fail above level 21 regardless of area of interest.") + readonly property string enterASpecificFeature: qsTr("Enter a specific feature to use") readonly property string enterATitle: qsTr("Enter a title") readonly property string enterUrlForTileService: qsTr("Enter a url for a tile service.") readonly property string estimatedOutputSize: qsTr("Estimated Output Size") @@ -169,16 +171,20 @@ QtObject { // S ----------------------------------------------------------------------- readonly property string saveAsBookmark: qsTr("Save as bookmark") + readonly property string saveAsGeojson: qsTr("Save as geojson") readonly property string saveTo: qsTr("Save To") readonly property string saveToDesc: qsTr("This button will open a file dialog chooser that allows the user to select the folder to save the tile package to locally.") readonly property string saveToLocationDesc: qsTr("Selected save to location") readonly property string saveTpkLocally: qsTr("Save tile package locally") readonly property string searchAddressOrLatLon: qsTr("Search address or @lat,lon") readonly property string selectAnOperation: qsTr("Select an Operation") + readonly property string selectNextFeature: qsTr("Select next feature") + readonly property string selectPreviousFeature: qsTr("Select previous feature") readonly property string selectTileService: qsTr("Select tile service to be used as the source for the tile package") readonly property string selectTileServiceDesc: qsTr("This control will select the tile service to export tiles from and will transition to the export area and details selection view.") readonly property string settings: qsTr("Settings") readonly property string settingsDesc: qsTr("The settings view allows you to change various parameters used in the Tile Package Kreator") + readonly property string shapefileSuccessfullyImported: qsTr("Shapefile successfully read and converted to geojson.") readonly property string shareThisItemWith: qsTr("Share this item with:") readonly property string sharingItem: qsTr("Sharing item.") readonly property string signOut: qsTr("Sign out") @@ -255,5 +261,6 @@ QtObject { property string xUpdatesAvaliableDesc: qsTr("This button is enabled when there are updates available to the application. The action on this button will only work when the button is enabled via the application.") property string uploadedSeeX: qsTr("Uploaded. See Tile Package Item") property string uploadingAndSharedSeeX: qsTr("Uploaded and Shared. See Tile Package Item") + property string viewingFeatureXofX: qsTr("Viewing feature %1 of %2") property string xSeconds: qsTr("%1 Seconds") } From a4d4c2a5b77cea77617c5b965b2c31590bfc52bf Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 29 Mar 2018 13:43:14 +1100 Subject: [PATCH 08/29] Updated online. --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index fe508eb..02e0246 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 3, + "micro": 4, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index e96ed19..28df7c9 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522216664000, + "modified": 1522291380000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 41, + "numComments": 42, "numRatings": 0, - "numViews": 240, + "numViews": 243, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 856475, + "size": 857710, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 0e51d29aebc78cff14a13af6fd7dab8f056a6d24 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 29 Mar 2018 14:41:35 +1100 Subject: [PATCH 09/29] Removed plugin parameter from map control --- MapViewPlus/MapView.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MapViewPlus/MapView.qml b/MapViewPlus/MapView.qml index 587841a..3640eeb 100644 --- a/MapViewPlus/MapView.qml +++ b/MapViewPlus/MapView.qml @@ -83,11 +83,11 @@ Item { value: internal.mapSources } - PluginParameter { - id: pluginMaxZoomLevel - name: "ArcGIS.mapping.maximumZoomLevel" - value: exportDetails.maxLevels - } +// PluginParameter { +// id: pluginMaxZoomLevel +// name: "ArcGIS.mapping.maximumZoomLevel" +// value: exportDetails.maxLevels +// } } center: QtPositioning.coordinate(defaultCenter.lat,defaultCenter.long) From 158edf8b8a63da98cbbecd6fc80812250cfb9d1b Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 29 Mar 2018 14:48:07 +1100 Subject: [PATCH 10/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appinfo.json b/appinfo.json index 02e0246..03bfa18 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 4, + "micro": 5, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 28df7c9..1a21bcc 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,9 +24,9 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522291380000, + "modified": 1522295044000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 42, + "numComments": 43, "numRatings": 0, "numViews": 243, "owner": "appstudio_apps", @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 857710, + "size": 858669, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 8abc7ffff9b7e3627475a31b2dff222b3466e8a2 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Tue, 3 Apr 2018 16:11:10 +1000 Subject: [PATCH 11/29] #60 Updated errors and messaging for non supported geometry features, Added ability to change search string --- AvailableServicesModel.qml | 2 +- ExportView.qml | 4 ++ IconFont.qml | 2 +- MainView.qml | 3 + MapViewPlus/GeoJsonHelper.qml | 8 ++- MapViewPlus/MapViewPlus.qml | 25 ++++++-- SettingsView.qml | 117 ++++++++++++++++++++++++++++++++++ StatusIndicator.qml | 10 +++ TilePackageKreator.qml | 7 ++ iteminfo.json | 4 +- singletons/Constants.qml | 1 + 11 files changed, 174 insertions(+), 9 deletions(-) diff --git a/AvailableServicesModel.qml b/AvailableServicesModel.qml index 07b396e..b4841c3 100644 --- a/AvailableServicesModel.qml +++ b/AvailableServicesModel.qml @@ -36,7 +36,7 @@ Item { property int tileServiceSum: 0 property var requests: [] property alias getAvailableServices: tileServicesSearch - property string searchQuery: '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))' + property string searchQuery: app.servicesSearchQuery //'(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))' property SqlQueryModel userAddedServices property bool useTimeout: app.timeoutNonResponsiveServices property int timeoutInterval: app.timeoutValue diff --git a/ExportView.qml b/ExportView.qml index 6a20b22..2696495 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -172,6 +172,10 @@ Item { zoomLevelIndicator.text = "%1".arg(parseFloat(level).toFixed(1)); } + onClearErrors: { + exportStatusIndicator.hideImmediately(); + } + onPositionChanged: { if (!cursorIsOffMap) { _displayCoordinates(position.coordinate); diff --git a/IconFont.qml b/IconFont.qml index eb173cc..d52ee5a 100644 --- a/IconFont.qml +++ b/IconFont.qml @@ -50,7 +50,7 @@ Item { id: _iconImage visible: !useIconFont anchors.centerIn: _tpkIcon - source: !useIconFont ? _tpkIcon.icon : "images/alpha.svg" + source: !useIconFont ? _tpkIcon.icon : "" sourceSize.width: _tpkIcon.iconImageSize * _tpkIcon.iconSizeMultiplier sourceSize.height: _tpkIcon.iconImageSize * _tpkIcon.iconSizeMultiplier mipmap: true diff --git a/MainView.qml b/MainView.qml index 6f37082..87c9421 100644 --- a/MainView.qml +++ b/MainView.qml @@ -107,6 +107,9 @@ Item { appMetrics.userEmail = portal.user.email; appMetrics.checkForUpdates(); + app.defaultSearchQuery = '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))'; + app.servicesSearchQuery = app.defaultSearchQuery; + if (!calledFromAnotherApp) { mainStackView.push(osv, {}, StackView.Immediate); } diff --git a/MapViewPlus/GeoJsonHelper.qml b/MapViewPlus/GeoJsonHelper.qml index 7b589ab..6878a09 100644 --- a/MapViewPlus/GeoJsonHelper.qml +++ b/MapViewPlus/GeoJsonHelper.qml @@ -42,6 +42,7 @@ Item{ signal success(var geometry) signal error(string message) + signal unsupportedGeometry() // METHODS ///////////////////////////////////////////////////////////////// @@ -135,9 +136,14 @@ Item{ if(features.geometry.type === "Polygon"){ returnGeometry.type = "esriGeometryPolygon"; } - if(features.geometry.type === "LineString"){ + else if(features.geometry.type === "LineString"){ returnGeometry.type = "esriGeometryPolyline"; } + else { + error("%1 feature. Feature type not supported.".arg(features.geometry.type)); + unsupportedGeometry(); + return; + } } if(geojson.hasOwnProperty("geometryType")){ diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 2d48191..82f402f 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -81,6 +81,7 @@ Item { signal drawingFinished() signal drawingCleared() signal drawingError(string error) + signal clearErrors() signal zoomLevelChanged(var level) signal positionChanged(var position) signal redraw(var data) @@ -369,6 +370,7 @@ Item { } onClicked: { + clearErrors(); var featureToGet = geoJsonHelper.currentFeature === 0 ? geoJsonHelper.numberOfFeatures - 1 : geoJsonHelper.currentFeature - 1; @@ -403,6 +405,8 @@ Item { rightPadding: 0 font.pointSize: Singletons.Config.mediumFontSizePoint onAccepted: { + clearErrors(); + var enteredNumber; if (!text.match(/^\d+$/)) { @@ -460,6 +464,7 @@ Item { } onClicked: { + clearErrors(); var featureToGet = geoJsonHelper.currentFeature === geoJsonHelper.numberOfFeatures - 1 ? 0 : geoJsonHelper.currentFeature + 1; @@ -567,7 +572,7 @@ Item { } onClicked: { - geoJsonHelper.saveGeoJsonToFile(geoJsonHelper.geojson, "geojson%1".arg(Date.now())); + geoJsonHelper.saveGeoJsonToFile(geoJsonHelper.geojson, "tpk_saved_geojson_%1".arg(Date.now().toString())); } Accessible.role: Accessible.Button @@ -727,7 +732,7 @@ Item { } } onClicked: { - if(map.zoomLevel > 0 && map.zoomLevel > map.minimumZoomLevel){ + if (map.zoomLevel > 0 && map.zoomLevel > map.minimumZoomLevel){ map.zoomLevel = Math.ceil(map.zoomLevel) - 1; } } @@ -803,6 +808,7 @@ Item { // drag.urls } onDropped: { + clearErrors(); var notJSON = false; @@ -1258,8 +1264,7 @@ Item { console.log("paste") if (AppFramework.clipboard.dataAvailable) { try { - var json = JSON.parse(AppFramework.clipboard.text) - //geoJsonHelper.parseGeometry(json); + var json = JSON.parse(AppFramework.clipboard.text); geoJsonHelper.setGeoJson(json); geoJsonHelper.getFeature(0); } @@ -1406,6 +1411,18 @@ Item { } mapViewPlus.map.fitViewportToMapItems(); + + if (!geoJsonPopup.visible) { + geoJsonPopup.open(); + } + } + + onUnsupportedGeometry: { + drawingFinished(); + clearDrawingCanvas(); + clearMap(); + drawingCleared(); + _updateDrawingHistory("clear", null); } onError: { diff --git a/SettingsView.qml b/SettingsView.qml index 506ffb9..de1c428 100644 --- a/SettingsView.qml +++ b/SettingsView.qml @@ -138,6 +138,123 @@ Item { color: Singletons.Colors.darkGray } + Item { + Layout.preferredWidth: parent.width + Layout.preferredHeight: sf(110) + + ColumnLayout { + anchors.fill: parent + spacing: sf(8) + Text { + Layout.fillHeight: true + Layout.preferredWidth: contentWidth + text: qsTr("Search Query for Tile Services (see Search API for more details)") + verticalAlignment: Text.AlignVCenter + wrapMode: Text.Wrap + color: Singletons.Colors.formElementFontColor + textFormat: Text.RichText + font { + family: notoRegular + pointSize: Singletons.Config.baseFontSizePoint + } + onLinkActivated: { + Qt.openUrlExternally(link); + } + } + + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(40) + Controls.StyledTextField { + id: searchQueryTextField + anchors.fill: parent + text: app.settings.value(Singletons.Constants.kSearchQueryString) + Component.onCompleted: { + cursorPosition = 0; + } + } + } + + RowLayout { + spacing: sf(5) + Layout.preferredHeight: sf(40) + Layout.fillWidth: true + + Item { + Layout.preferredWidth: sf(140) + Layout.fillHeight: true + Button { + anchors.fill: parent + + background: Rectangle { + anchors.fill: parent + color: Singletons.Config.buttonStates(parent, "clear") + radius: app.info.properties.mainButtonRadius + border.width: 0 + border.color: app.info.properties.mainButtonBorderColor + } + Text { + color: app.info.properties.mainButtonBorderColor + anchors.centerIn: parent + textFormat: Text.RichText + text: qsTr("Reset to default") + font.pointSize: Singletons.Config.baseFontSizePoint + font.family: notoRegular + } + onClicked: { + searchQueryTextField.text = app.defaultSearchQuery; + updateButton.clicked(); + } + } + } + Item { + Layout.fillWidth: true + } + + Item { + Layout.preferredWidth: sf(100) + Layout.fillHeight: true + Button { + id: updateButton + anchors.fill: parent + enabled: searchQueryTextField.text > "" + background: Rectangle { + anchors.fill: parent + color: Singletons.Config.buttonStates(parent) + radius: app.info.properties.mainButtonRadius + border.width: parent.enabled ? app.info.properties.mainButtonBorderWidth : 0 + border.color: app.info.properties.mainButtonBorderColor + } + Text { + color: app.info.properties.mainButtonFontColor + anchors.centerIn: parent + textFormat: Text.RichText + text: qsTr("Update") + font.pointSize: Singletons.Config.baseFontSizePoint + font.family: notoRegular + } + onClicked: { + app.servicesSearchQuery = searchQueryTextField.text; + } + } + } + + + + } + } + + + } + + Rectangle { + Layout.preferredHeight: sf(1) + Layout.fillWidth: true + Layout.topMargin: sf(20) + Layout.bottomMargin: sf(20) + color: Singletons.Colors.darkGray + } + //---------------------------------------------------------------------- // Item { diff --git a/StatusIndicator.qml b/StatusIndicator.qml index 0b728bf..f9aae53 100644 --- a/StatusIndicator.qml +++ b/StatusIndicator.qml @@ -61,6 +61,7 @@ Rectangle { signal show() signal hide() + signal hideImmediately() signal linkClicked(string link) color: messageType.backgroundColor @@ -143,6 +144,15 @@ Rectangle { fader.start() } + //-------------------------------------------------------------------------- + + onHideImmediately: { + esriStatusIndicator.visible = false; + if (hideStatusMessage.running) { + hideStatusMessage.stop(); + } + } + // COMPONENTS ////////////////////////////////////////////////////////////// Timer { diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index b70e03f..a8d1adb 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -45,6 +45,9 @@ App { property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false) property bool timeoutNonResponsiveServices: app.settings.boolValue(Singletons.Constants.kTimeOutUnresponsiveServices, true) property int timeoutValue: app.settings.numberValue(Singletons.Constants.kTimeOutValue, 7) + property string defaultSearchQuery: '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:("Map Service") AND group:(access:org))' + property string servicesSearchQuery: app.settings.value(Singletons.Constants.kSearchQueryString, defaultSearchQuery); + Component.onCompleted: { if (!appDatabase.exists()) { @@ -77,6 +80,10 @@ App { app.settings.setValue(Singletons.Constants.kTimeOutValue, timeoutValue); } + onServicesSearchQueryChanged: { + app.settings.setValue(Singletons.Constants.kSearchQueryString, servicesSearchQuery); + } + // COMPONENTS ////////////////////////////////////////////////////////////// Portal { diff --git a/iteminfo.json b/iteminfo.json index 1a21bcc..728a968 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -10,7 +10,7 @@ "commentsEnabled": true, "created": 1481688674000, "culture": "en-au", - "description": "\n

Tile package creation tool.

", + "description": "\n

Tile package creation tool.

", "documentation": null, "extent": [ ], @@ -22,7 +22,7 @@ "languages": [ ], "largeThumbnail": null, - "licenseInfo": "\n


", + "licenseInfo": "", "listed": false, "modified": 1522295044000, "name": "561a8441825441349a3b1ad23fdaea75.zip", diff --git a/singletons/Constants.qml b/singletons/Constants.qml index 1ea9f36..9f0eec3 100644 --- a/singletons/Constants.qml +++ b/singletons/Constants.qml @@ -40,4 +40,5 @@ QtObject { readonly property string kAllowNonWebMercatorServices: "allowNonWebMercatorServices" readonly property string kTimeOutUnresponsiveServices: "timeoutUnresponsiveServices" readonly property string kTimeOutValue: "timeoutValue" + readonly property string kSearchQueryString: "searchQueryString" } From 3e279eda307d0d22b1cfc3aaec052e6ee0e4b97f Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Tue, 3 Apr 2018 16:20:41 +1000 Subject: [PATCH 12/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/appinfo.json b/appinfo.json index 03bfa18..ce2915a 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 5, + "micro": 6, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 728a968..8ed8ecb 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -10,7 +10,7 @@ "commentsEnabled": true, "created": 1481688674000, "culture": "en-au", - "description": "\n

Tile package creation tool.

", + "description": "\n

Tile package creation tool.

", "documentation": null, "extent": [ ], @@ -22,13 +22,13 @@ "languages": [ ], "largeThumbnail": null, - "licenseInfo": "", + "licenseInfo": "\n


", "listed": false, - "modified": 1522295044000, + "modified": 1522736016000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 43, + "numComments": 44, "numRatings": 0, - "numViews": 243, + "numViews": 246, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 858669, + "size": 858822, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From bf462d98be11a2bdf98e5531aafaac77312d4859 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 10:19:25 +1000 Subject: [PATCH 13/29] #60 Fixed error with interpretation of esri json, disabled feature browsing buttons when only 1 feature. --- MapViewPlus/GeoJsonHelper.qml | 175 ++++++++++++++++++---------------- MapViewPlus/MapViewPlus.qml | 3 + 2 files changed, 97 insertions(+), 81 deletions(-) diff --git a/MapViewPlus/GeoJsonHelper.qml b/MapViewPlus/GeoJsonHelper.qml index 6878a09..f84587f 100644 --- a/MapViewPlus/GeoJsonHelper.qml +++ b/MapViewPlus/GeoJsonHelper.qml @@ -39,6 +39,7 @@ Item{ property int currentFeature: 0 property int numberOfFeatures: 0 + property bool multipleFeatures: numberOfFeatures > 1 signal success(var geometry) signal error(string message) @@ -55,11 +56,11 @@ Item{ if (geoJsonFileFolder.fileExists(filepath)) { try { - var json = geoJsonFileFolder.readJsonFile(filepath) + var json = geoJsonFileFolder.readJsonFile(filepath); setGeoJson(json); getFeature(0); } - catch(error) { + catch(e) { error("There was an error reading the JSON file."); } } @@ -93,106 +94,118 @@ Item{ return; } + if (!geojson.hasOwnProperty("features")) { + error("JSON is missing 'features' attribute."); + return; + } + var features; var isWebMercator = false; - if (geojson.hasOwnProperty("features")) { - - if (feature === undefined || feature < 0 || feature > geojson.features.length){ - feature = 0; - } + if (feature === undefined || feature < 0 || feature > geojson.features.length){ + feature = 0; + } - features = geojson.features[feature]; + features = geojson.features[feature]; - // Esri geojson has crs property ----------------------------------- + // Esri geojson has crs property ----------------------------------- - if(geojson.hasOwnProperty("crs")){ - var sr = geojson.crs.properties.name; - if(sr.indexOf("3857") > -1 || sr.indexOf("102100") > -1){ - isWebMercator = true; - //returnGeometry.spatialReference = 3857; - } - else if(sr.indexOf("4326") > -1){ - returnGeometry.spatialReference = 4326; - } - else{ - returnGeometry.spatialRefernce = null; - error("Spatial reference cannot be determined for geojson file.") - } + if (geojson.hasOwnProperty("crs")) { + var sr = geojson.crs.properties.name; + if (sr.indexOf("3857") > -1 || sr.indexOf("102100") > -1) { + isWebMercator = true; + //returnGeometry.spatialReference = 3857; + } + else if (sr.indexOf("4326") > -1) { + returnGeometry.spatialReference = 4326; + } + else { + returnGeometry.spatialRefernce = null; + error("Spatial reference cannot be determined for geojson file.") } + } - // Esri json has spatialReference property ------------------------- + // Esri json has spatialReference property ------------------------- - if(geojson.hasOwnProperty("spatialReference")){ - if(geojson.spatialReference.wkid === 102100 || geojson.spatialReference.wkid === 3857 || geojson.spatialReference.latestWkid === 3857){ - //returnGeometry.spatialReference = 3857; - isWebMercator = true; - } + if (geojson.hasOwnProperty("spatialReference")) { + console.log("has spatialReference") + if (geojson.spatialReference.wkid === 102100 || geojson.spatialReference.wkid === 3857 || geojson.spatialReference.latestWkid === 3857) { + //returnGeometry.spatialReference = 3857; + isWebMercator = true; } + } - // Normalize type, for convenience normalize to esri types ----- + // Normalize type, for convenience normalize to esri types ----- - if(features.geometry.hasOwnProperty("type")){ - if(features.geometry.type === "Polygon"){ - returnGeometry.type = "esriGeometryPolygon"; - } - else if(features.geometry.type === "LineString"){ - returnGeometry.type = "esriGeometryPolyline"; - } - else { - error("%1 feature. Feature type not supported.".arg(features.geometry.type)); - unsupportedGeometry(); - return; - } + if (features.geometry.hasOwnProperty("type")) { + if (features.geometry.type === "Polygon") { + returnGeometry.type = "esriGeometryPolygon"; } - - if(geojson.hasOwnProperty("geometryType")){ - returnGeometry.type = json.geometryType; + else if (features.geometry.type === "LineString") { + returnGeometry.type = "esriGeometryPolyline"; } + else { + error("%1 feature. Feature type not supported.".arg(features.geometry.type)); + unsupportedGeometry(); + return; + } + } + if (geojson.hasOwnProperty("geometryType")){ - if(features.hasOwnProperty("geometry")){ + returnGeometry.type = geojson.geometryType; - if(features.geometry.hasOwnProperty("coordinates")){ - returnGeometry.coordinates = (returnGeometry.type === "esriGeometryPolygon") ? features.geometry.coordinates[0]: features.geometry.coordinates; - } - else if(features.geometry.hasOwnProperty("paths")){ - if(features.geometry.paths.length > 0){ - returnGeometry.coordinates = features.geometry.paths[0]; + if (returnGeometry.type !== "esriGeometryPolygon" && returnGeometry.type !== "esriGeometryPolyline") { + error("%1 feature. Feature type not supported.".arg(geojson.geometryType)); + unsupportedGeometry(); + return; + } + } + + if (features.hasOwnProperty("geometry")) { + + if (features.geometry.hasOwnProperty("coordinates")) { + returnGeometry.coordinates = (returnGeometry.type === "esriGeometryPolygon") ? features.geometry.coordinates[0]: features.geometry.coordinates; + } + else if (features.geometry.hasOwnProperty("paths")) { + if (features.geometry.paths.length > 0) { + if (features.geometry.paths.length > 1) { + error(qsTr("Multi-part path features not supported currently. Showing first path only.")); } + returnGeometry.coordinates = features.geometry.paths[0]; } - else if(features.geometry.hasOwnProperty("rings")){ - if(features.geometry.rings.length > 0){ - returnGeometry.coordinates = features.geometry.rings[0]; + } + else if (features.geometry.hasOwnProperty("rings")) { + if (features.geometry.rings.length > 0) { + if (features.geometry.rings.length > 1) { + error(qsTr("Multi-part polygon features not supported currently. Showing first polygon only.")); } + returnGeometry.coordinates = features.geometry.rings[0]; } - else{ - returnGeometry.coordinates = []; - } - - // NOTE: Might need to throw an error if coordinate count is way way too large. Needs testing. + } + else { + returnGeometry.coordinates = []; + } - if(returnGeometry.coordinates.length > 0){ - if(isWebMercator){ - var newCoordsInLngLat = []; - for(var i = 0; i < returnGeometry.coordinates.length; i++){ - newCoordsInLngLat.push(converter.xyToLngLat(returnGeometry.coordinates[i])); - } + // NOTE: Might need to throw an error if coordinate count is way way too large. Needs testing. - returnGeometry.coordinates = newCoordsInLngLat; + if (returnGeometry.coordinates.length > 0) { + if (isWebMercator) { + var newCoordsInLngLat = []; + for (var i = 0; i < returnGeometry.coordinates.length; i++) { + newCoordsInLngLat.push(converter.xyToLngLat(returnGeometry.coordinates[i])); } - returnGeometry.coordinatesForQML = _prepareGeometryForQMLMap(returnGeometry.coordinates); - - success(returnGeometry); - } - else{ - error("JSON is missing geometry"); + returnGeometry.coordinates = newCoordsInLngLat; } + + returnGeometry.coordinatesForQML = _prepareGeometryForQMLMap(returnGeometry.coordinates); + + success(returnGeometry); + } + else { + error("JSON is missing geometry"); } - } - else{ - error("JSON is missing 'features' attribute"); } } @@ -202,7 +215,7 @@ Item{ var qmlGeometry = []; - for(var i = 0; i < coords.length; i++){ + for (var i = 0; i < coords.length; i++) { var set = coords[i]; @@ -232,7 +245,7 @@ Item{ if (g.hasOwnProperty("type")) { - if(g.type === Singletons.Constants.kMultipath) { + if (g.type === Singletons.Constants.kMultipath) { gType = "LineString"; gCoords = []; for(var x = 0; x < g.geometry.length; x++){ @@ -240,10 +253,10 @@ Item{ } } - if(g.type === Singletons.Constants.kPolygon){ + if (g.type === Singletons.Constants.kPolygon) { gType = "Polygon"; gCoords = [[]]; - for(var y = 0; y < g.geometry.length; y++){ + for (var y = 0; y < g.geometry.length; y++) { gCoords[0].push([g.geometry[y].coordinate.longitude, g.geometry[y].coordinate.latitude]); } } @@ -295,13 +308,13 @@ Item{ //-------------------------------------------------------------------------- - CoordinateConverter{ + CoordinateConverter { id:converter } //-------------------------------------------------------------------------- - GeometryUtilities{ + GeometryUtilities { id: geomUtilities } diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 82f402f..51a9bb7 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -355,6 +355,7 @@ Item { ToolTip.visible: hovered ToolTip.text: Singletons.Strings.selectPreviousFeature + enabled: geoJsonHelper.multipleFeatures background: Rectangle{ color: "transparent" @@ -404,6 +405,7 @@ Item { leftPadding: 0 rightPadding: 0 font.pointSize: Singletons.Config.mediumFontSizePoint + enabled: geoJsonHelper.multipleFeatures onAccepted: { clearErrors(); @@ -449,6 +451,7 @@ Item { ToolTip.visible: hovered ToolTip.text: Singletons.Strings.selectNextFeature + enabled: geoJsonHelper.multipleFeatures background: Rectangle{ color: "transparent" From b9cece276f9a09b86d583c4d65dd8610c2475958 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 10:20:09 +1000 Subject: [PATCH 14/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index ce2915a..bb0ea5f 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 6, + "micro": 7, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 8ed8ecb..5549add 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522736016000, + "modified": 1522801193000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 44, + "numComments": 45, "numRatings": 0, - "numViews": 246, + "numViews": 249, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 858822, + "size": 858956, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 5dc383a9478cc538bfeac969d18e927ea81cbedf Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 12:40:39 +1000 Subject: [PATCH 15/29] #67 Updated custom search functionality --- AvailableServicesModel.qml | 6 +++++- Controls/StyledCheckBox.qml | 3 ++- MainView.qml | 3 +-- SettingsView.qml | 23 +++++++++++++++++------ TilePackageKreator.qml | 7 ++++++- singletons/Constants.qml | 1 + 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/AvailableServicesModel.qml b/AvailableServicesModel.qml index b4841c3..fdd1b7a 100644 --- a/AvailableServicesModel.qml +++ b/AvailableServicesModel.qml @@ -36,7 +36,11 @@ Item { property int tileServiceSum: 0 property var requests: [] property alias getAvailableServices: tileServicesSearch - property string searchQuery: app.servicesSearchQuery //'(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))' + property string searchQuery: !app.includeCurrentUserInSearch + ? app.servicesSearchQuery + : app.currentUserSearchQuery > "" + ? app.servicesSearchQuery + " " + app.currentUserSearchQuery + : app.servicesSearchQuery property SqlQueryModel userAddedServices property bool useTimeout: app.timeoutNonResponsiveServices property int timeoutInterval: app.timeoutValue diff --git a/Controls/StyledCheckBox.qml b/Controls/StyledCheckBox.qml index dc3effa..47aa008 100755 --- a/Controls/StyledCheckBox.qml +++ b/Controls/StyledCheckBox.qml @@ -35,6 +35,7 @@ CheckBox { property string label: "Checkbox" property string tooltip: "" property bool displayTooltip: tooltip > "" ? true : false + property double fontSizeMultiplier: 1 ToolTip.visible: displayTooltip && hovered ToolTip.text: tooltip @@ -72,7 +73,7 @@ CheckBox { wrapMode: Text.Wrap font { family: notoRegular - pointSize: Singletons.Config.baseFontSizePoint + pointSize: Singletons.Config.baseFontSizePoint * control.fontSizeMultiplier } onLinkActivated: { Qt.openUrlExternally(link); diff --git a/MainView.qml b/MainView.qml index 87c9421..7f0bb24 100644 --- a/MainView.qml +++ b/MainView.qml @@ -107,8 +107,7 @@ Item { appMetrics.userEmail = portal.user.email; appMetrics.checkForUpdates(); - app.defaultSearchQuery = '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:("Map Service") AND group:(access:org))'; - app.servicesSearchQuery = app.defaultSearchQuery; + app.currentUserSearchQuery = 'OR (type:"Map Service" AND owner:' + portal.username + ') OR (type:"Image Service" AND owner:' + portal.username + ')'; if (!calledFromAnotherApp) { mainStackView.push(osv, {}, StackView.Immediate); diff --git a/SettingsView.qml b/SettingsView.qml index de1c428..7072b82 100644 --- a/SettingsView.qml +++ b/SettingsView.qml @@ -140,7 +140,7 @@ Item { Item { Layout.preferredWidth: parent.width - Layout.preferredHeight: sf(110) + Layout.preferredHeight: sf(160) ColumnLayout { anchors.fill: parent @@ -175,6 +175,21 @@ Item { } } + Item { + Layout.fillWidth: true + Layout.preferredHeight: sf(50) + Controls.StyledCheckBox { + id: includeCurrentUserSearchQuery + anchors.fill: parent + checked: app.includeCurrentUserInSearch + label: qsTr("Include Map and Image Services owned by %1 in query?
%2".arg(portal.username).arg(app.currentUserSearchQuery)) + fontSizeMultiplier: .8 + onCheckedChanged: { + app.includeCurrentUserInSearch = checked; + } + } + } + RowLayout { spacing: sf(5) Layout.preferredHeight: sf(40) @@ -203,6 +218,7 @@ Item { } onClicked: { searchQueryTextField.text = app.defaultSearchQuery; + includeCurrentUserSearchQuery.checked = true; updateButton.clicked(); } } @@ -238,13 +254,8 @@ Item { } } } - - - } } - - } Rectangle { diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index a8d1adb..e05c454 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -46,9 +46,10 @@ App { property bool timeoutNonResponsiveServices: app.settings.boolValue(Singletons.Constants.kTimeOutUnresponsiveServices, true) property int timeoutValue: app.settings.numberValue(Singletons.Constants.kTimeOutValue, 7) property string defaultSearchQuery: '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:("Map Service") AND group:(access:org))' + property string currentUserSearchQuery: "" + property bool includeCurrentUserInSearch: app.settings.boolValue(Singletons.Constants.kIncludeCurrentUserInSearch, true); property string servicesSearchQuery: app.settings.value(Singletons.Constants.kSearchQueryString, defaultSearchQuery); - Component.onCompleted: { if (!appDatabase.exists()) { appDatabase.createDatabase(); @@ -84,6 +85,10 @@ App { app.settings.setValue(Singletons.Constants.kSearchQueryString, servicesSearchQuery); } + onIncludeCurrentUserInSearchChanged: { + app.settings.boolValue(Singletons.Constants.kIncludeCurrentUserInSearch, includeCurrentUserInSearch); + } + // COMPONENTS ////////////////////////////////////////////////////////////// Portal { diff --git a/singletons/Constants.qml b/singletons/Constants.qml index 9f0eec3..f6047c9 100644 --- a/singletons/Constants.qml +++ b/singletons/Constants.qml @@ -41,4 +41,5 @@ QtObject { readonly property string kTimeOutUnresponsiveServices: "timeoutUnresponsiveServices" readonly property string kTimeOutValue: "timeoutValue" readonly property string kSearchQueryString: "searchQueryString" + readonly property string kIncludeCurrentUserInSearch: "includeCurrentUser" } From c13f0c2d8cea8d2f2d829a685653bf0dfa03ec19 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 12:42:16 +1000 Subject: [PATCH 16/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index bb0ea5f..8afc04f 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 7, + "micro": 8, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 5549add..42d121e 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522801193000, + "modified": 1522809716000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 45, + "numComments": 46, "numRatings": 0, - "numViews": 249, + "numViews": 252, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 858956, + "size": 860084, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 03ff7e38ddebd63141e4dbfafdd398d0a07d6b0b Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 13:06:38 +1000 Subject: [PATCH 17/29] Added default font family --- TilePackageKreator.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index e05c454..d17ad27 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -36,10 +36,10 @@ App { property bool useIconFont: Qt.platform.os !== "windows" ? true : false property string icons: _icons.status == FontLoader.Ready ? _icons.name : "tilepackage" - property string notoRegular: _notoRegular.status == FontLoader.Ready ? _notoRegular.name : "Noto Sans" - property string notoBold: _notoBold.status == FontLoader.Ready ? _notoBold.name : "Noto Sans" - property string notoItalic: _notoItalic.status == FontLoader.Ready ? _notoItalic.name : "Noto Sans" - property string notoBoldItalic: _notoBoldItalic.status == FontLoader.Ready ? _notoBoldItalic.name : "Noto Sans" + property string notoRegular: _notoRegular.status == FontLoader.Ready ? _notoRegular.name : Qt.application.font.family + property string notoBold: _notoBold.status == FontLoader.Ready ? _notoBold.name : Qt.application.font.family + property string notoItalic: _notoItalic.status == FontLoader.Ready ? _notoItalic.name : Qt.application.font.family + property string notoBoldItalic: _notoBoldItalic.status == FontLoader.Ready ? _notoBoldItalic.name : Qt.application.font.family property bool allowAllLevels: app.settings.boolValue(Singletons.Constants.kAllowAllZoomLevels, false) property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false) From b69c73eb3c0565d5f081707b562ab15dcbb49774 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 13:30:43 +1000 Subject: [PATCH 18/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index 8afc04f..2fdc19c 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 8, + "micro": 9, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 42d121e..30ed711 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522809716000, + "modified": 1522812593000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 46, + "numComments": 47, "numRatings": 0, - "numViews": 252, + "numViews": 255, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860084, + "size": 860092, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 3827f126e42abd11b62ca406c1a7628c53d71253 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 14:33:50 +1000 Subject: [PATCH 19/29] Removed custom Noto font family, set application to use system default --- AboutDialog/AboutDialog.qml | 2 +- AboutDialog/AboutLabelValue.qml | 4 ++-- AboutDialog/AboutText.qml | 2 +- AppMetrics/FeedbackDialog.qml | 14 ++++++------- AppToolBar.qml | 2 +- AvailableServicesView.qml | 25 ++++++++++++------------ BrowseOrgView.qml | 11 ++++++----- Controls/StyledCheckBox.qml | 2 +- Controls/StyledComboBox.qml | 4 ++-- Controls/StyledRadioButton.qml | 2 +- Controls/StyledTextField.qml | 2 +- DetailsForm.qml | 26 ++++++++++++------------- ExportView.qml | 18 ++++++++--------- HistoryView.qml | 8 ++++---- MapViewPlus/GeoSearch.qml | 4 ++-- MapViewPlus/MapDrawingMenu.qml | 2 +- MapViewPlus/MapViewPlus.qml | 16 +++++++-------- OperationSelectionView.qml | 12 ++++++------ Portal/BuiltInSignInView.qml | 2 +- Portal/PortalSettingsPage.qml | 2 +- Portal/PortalSignInView.qml | 4 ++-- ProgressIndicator/ProgressIndicator.qml | 2 +- SettingsView.qml | 6 +++--- StatusIndicator.qml | 2 +- TilePackageKreator.qml | 24 ++--------------------- UploadView.qml | 14 ++++++------- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 28 files changed, 102 insertions(+), 120 deletions(-) diff --git a/AboutDialog/AboutDialog.qml b/AboutDialog/AboutDialog.qml index 937206d..4f44187 100644 --- a/AboutDialog/AboutDialog.qml +++ b/AboutDialog/AboutDialog.qml @@ -54,7 +54,7 @@ Dialog { text: qsTr("About %1").arg(app.info.title) wrapMode: Text.WrapAtWordBoundaryOrAnywhere - font.family: notoRegular + font.family: defaultFontFamily font { pointSize: 22 bold: true diff --git a/AboutDialog/AboutLabelValue.qml b/AboutDialog/AboutLabelValue.qml index fa91af8..df1e9cd 100644 --- a/AboutDialog/AboutLabelValue.qml +++ b/AboutDialog/AboutLabelValue.qml @@ -43,7 +43,7 @@ Item { pointSize: valueText.font.pointSize bold: !valueText.font.bold } - font.family: notoRegular + font.family: defaultFontFamily text: "Label" anchors { left: parent.left @@ -57,7 +57,7 @@ Item { pointSize: 9 bold: true } - font.family: notoRegular + font.family: defaultFontFamily color: labelText.color wrapMode: Text.WordWrap diff --git a/AboutDialog/AboutText.qml b/AboutDialog/AboutText.qml index df89808..27138d4 100644 --- a/AboutDialog/AboutText.qml +++ b/AboutDialog/AboutText.qml @@ -25,7 +25,7 @@ Text { font { pointSize: 14 } - font.family: notoRegular + font.family: defaultFontFamily onLinkActivated: { Qt.openUrlExternally(link); diff --git a/AppMetrics/FeedbackDialog.qml b/AppMetrics/FeedbackDialog.qml index 924dd8f..6236c23 100644 --- a/AppMetrics/FeedbackDialog.qml +++ b/AppMetrics/FeedbackDialog.qml @@ -60,7 +60,7 @@ Dialog { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.largeFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.formElementFontColor } } @@ -82,7 +82,7 @@ Dialog { textFormat: Text.RichText text: qsTr("Subject") + "*" verticalAlignment: Text.AlignVCenter - font.family: notoRegular + font.family: defaultFontFamily } TextField { @@ -99,7 +99,7 @@ Dialog { color: Singletons.Colors.formElementBackground } textColor: Singletons.Colors.formElementFontColor - font.family: notoRegular + font.family: defaultFontFamily } onTextChanged: { @@ -132,7 +132,7 @@ Dialog { textFormat: Text.RichText text: qsTr("Message") + "*" verticalAlignment: Text.AlignTop - font.family: notoRegular + font.family: defaultFontFamily } TextArea { id: feedbackMessage @@ -141,7 +141,7 @@ Dialog { style: TextAreaStyle { backgroundColor: Singletons.Colors.formElementBackground textColor: Singletons.Colors.formElementFontColor - font.family: notoRegular + font.family: defaultFontFamily frame: Rectangle { border.width: Singletons.Config.formElementBorderWidth border.color: Singletons.Colors.formElementBorderColor @@ -194,7 +194,7 @@ Dialog { textFormat: Text.RichText text: qsTr("Cancel") font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { @@ -236,7 +236,7 @@ Dialog { textFormat: Text.RichText text: qsTr("Send") font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } diff --git a/AppToolBar.qml b/AppToolBar.qml index b5bb13c..7a1277d 100644 --- a/AppToolBar.qml +++ b/AppToolBar.qml @@ -133,7 +133,7 @@ Item { anchors.centerIn: parent verticalAlignment: Text.AlignVCenter leftPadding: sf(20) - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: toolBarFontPointSize color: toolBarFontColor textFormat: Text.RichText diff --git a/AvailableServicesView.qml b/AvailableServicesView.qml index 34662a7..52d1ed2 100644 --- a/AvailableServicesView.qml +++ b/AvailableServicesView.qml @@ -14,8 +14,8 @@ * */ -import QtQuick 2.7 -import QtQuick.Controls 2.1 +import QtQuick 2.9 +import QtQuick.Controls 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtGraphicalEffects 1.0 @@ -166,7 +166,7 @@ Item { Text { anchors.fill: parent id: servicesStatusText - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.largeFontSizePoint text: Singletons.Strings.queryingServices verticalAlignment: Text.AlignTop @@ -208,7 +208,7 @@ Item { anchors.leftMargin: sf(20) verticalAlignment: Text.AlignVCenter text: Singletons.Strings.selectTileService - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Heading Accessible.name: text @@ -296,7 +296,7 @@ Item { color: _uiEntryElementStates(parent) } color: Singletons.Colors.formElementFontColor - font.family: notoRegular + font.family: defaultFontFamily validator: RegExpValidator { regExp: /(http(s)*:\/\/).*/g @@ -329,7 +329,7 @@ Item { textFormat: Text.RichText text: parent.buttonText font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Accessible.ignored: true } @@ -368,7 +368,7 @@ Item { textFormat: Text.RichText text: parent.buttonText font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Accessible.ignored: true } @@ -429,7 +429,8 @@ Item { Text { anchors.centerIn: parent text: Singletons.Strings.noExportTileServices - font.family: notoBold + font.family: defaultFontFamily + font.weight: Font.Bold font.pointSize: Singletons.Config.largeFontSizePoint color: Singletons.Colors.boldUIElementFontColor } @@ -582,7 +583,7 @@ Item { anchors.margins: sf(10) font { pointSize: Singletons.Config.smallFontSizePoint - family: notoRegular + family: defaultFontFamily } color: Singletons.Colors.boldUIElementFontColor verticalAlignment: Text.AlignVCenter @@ -618,7 +619,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily text: spatialReference || "N/A" color: isWebMercator ? "#007ac2" : "red" elide: Text.ElideRight @@ -642,7 +643,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily text: owner === "esri" ? "Esri" : "Non-Esri" color: owner === "esri" ? "#007ac2" : "darkorange" @@ -738,7 +739,7 @@ Item { width: parent.width text: "" color: app.info.properties.toolBarBackgroundColor - font.family: notoRegular + font.family: defaultFontFamily readOnly: true textFormat: Text.RichText wrapMode: TextArea.Wrap diff --git a/BrowseOrgView.qml b/BrowseOrgView.qml index 1fa809a..4d2e2a4 100644 --- a/BrowseOrgView.qml +++ b/BrowseOrgView.qml @@ -124,7 +124,8 @@ Item { Text { anchors.centerIn: parent text: Singletons.Strings.noOrgTileServices - font.family: notoBold + font.family: defaultFontFamily + font.weight: Font.Bold font.pointSize: Singletons.Config.largeFontSizePoint color: Singletons.Colors.boldUIElementFontColor } @@ -238,7 +239,7 @@ Item { anchors.margins: sf(10) font { pointSize: Singletons.Config.smallFontSizePoint - family: notoRegular + family: defaultFontFamily } color: Singletons.Colors.boldUIElementFontColor verticalAlignment: Text.AlignVCenter @@ -274,7 +275,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily text: spatialReference color: isWebMercator ? "#007ac2" : "red" elide: Text.ElideRight @@ -298,7 +299,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily text: owner === "esri" ? "Esri" : "Non-Esri" color: owner === "esri" ? "#007ac2" : "darkorange" @@ -461,7 +462,7 @@ Item { width: parent.width text: "" color: app.info.properties.toolBarBackgroundColor - font.family: notoRegular + font.family: defaultFontFamily readOnly: true textFormat: Text.RichText wrapMode: TextArea.Wrap diff --git a/Controls/StyledCheckBox.qml b/Controls/StyledCheckBox.qml index 47aa008..742d019 100755 --- a/Controls/StyledCheckBox.qml +++ b/Controls/StyledCheckBox.qml @@ -72,7 +72,7 @@ CheckBox { textFormat: Text.RichText wrapMode: Text.Wrap font { - family: notoRegular + family: defaultFontFamily pointSize: Singletons.Config.baseFontSizePoint * control.fontSizeMultiplier } onLinkActivated: { diff --git a/Controls/StyledComboBox.qml b/Controls/StyledComboBox.qml index 7fa8d2f..b6633ac 100644 --- a/Controls/StyledComboBox.qml +++ b/Controls/StyledComboBox.qml @@ -5,7 +5,7 @@ import "../singletons" as Singletons ComboBox { id: control - font: notoRegular + font: defaultFontFamily onActivated: { console.log(currentIndex) @@ -58,7 +58,7 @@ ComboBox { rightPadding: control.indicator.width + control.spacing text: control.model !== null ? control.model.get(control.currentIndex)[control.textRole] : "" - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.smallFontSizePoint color: Singletons.Colors.darkGray horizontalAlignment: Text.AlignLeft diff --git a/Controls/StyledRadioButton.qml b/Controls/StyledRadioButton.qml index fe6f139..7a275db 100755 --- a/Controls/StyledRadioButton.qml +++ b/Controls/StyledRadioButton.qml @@ -54,7 +54,7 @@ RadioButton { rightPadding: !control.rtl ? 0 : control.indicator.width + sf(1) color: Singletons.Colors.darkGray font { - family: notoRegular + family: defaultFontFamily pointSize: Singletons.Config.smallFontSizePoint } } diff --git a/Controls/StyledTextField.qml b/Controls/StyledTextField.qml index 9275a6e..64d4713 100755 --- a/Controls/StyledTextField.qml +++ b/Controls/StyledTextField.qml @@ -30,7 +30,7 @@ TextField { color: parent.enabled ? "#fff" : Singletons.Colors.lightGray } color: Singletons.Colors.darkGray - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.smallFontSizePoint Accessible.role: Accessible.EditableText diff --git a/DetailsForm.qml b/DetailsForm.qml index 4f2160e..3c28920 100644 --- a/DetailsForm.qml +++ b/DetailsForm.qml @@ -153,7 +153,7 @@ Rectangle { text: Singletons.Strings.currentTileService color: Singletons.Colors.darkGray font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Layout.fillWidth: true Layout.fillHeight: true @@ -204,7 +204,7 @@ Rectangle { text: Singletons.Strings.numberOfZoomLevels color: Singletons.Colors.darkGray font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Layout.fillWidth: true Layout.fillHeight: true @@ -254,7 +254,7 @@ Rectangle { horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter font.pointSize: Singletons.Config.mediumFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.darkGray Accessible.role: Accessible.StaticText @@ -318,7 +318,7 @@ Rectangle { text: Singletons.Strings.bufferRadius color: Singletons.Colors.darkGray font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Layout.fillWidth: true Layout.fillHeight: true Accessible.role: Accessible.Heading @@ -412,7 +412,7 @@ Rectangle { text: Singletons.Strings.title + " *" textFormat: Text.RichText font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.darkGray verticalAlignment: Text.AlignVCenter @@ -460,7 +460,7 @@ Rectangle { id: tpkFileTitleName anchors.fill: parent font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.formElementFontColor } } @@ -484,7 +484,7 @@ Rectangle { text: Singletons.Strings.saveTo //qsTr("Save To") color: Singletons.Colors.darkGray font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Layout.fillWidth: true Layout.preferredHeight: sf(20) Accessible.role: Accessible.Heading @@ -546,7 +546,7 @@ Rectangle { Text { text: Singletons.Strings.saveTo color: app.info.properties.mainButtonFontColor - font.family: notoRegular + font.family: defaultFontFamily anchors.centerIn: parent } } @@ -575,7 +575,7 @@ Rectangle { id: saveToLocationFolder text: "" font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily fontSizeMode: Text.Fit minimumPointSize: 10 verticalAlignment: Text.AlignVCenter @@ -649,7 +649,7 @@ Rectangle { Layout.preferredWidth: parent.width/2 text: Singletons.Strings.description font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.darkGray verticalAlignment: Text.AlignVCenter Accessible.role: Accessible.Heading @@ -662,7 +662,7 @@ Rectangle { Layout.fillWidth: true text: "4000" font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.darkGray horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter @@ -695,7 +695,7 @@ Rectangle { wrapMode: Text.Wrap color: Singletons.Colors.formElementFontColor - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.xSmallFontSizePoint background: Rectangle { color: _uiEntryElementStates(parent) @@ -733,7 +733,7 @@ Rectangle { Label { text: Singletons.Strings.shareThisItemWith font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily color: Singletons.Colors.mainLabelFontColor anchors.fill: parent verticalAlignment: Text.AlignVCenter diff --git a/ExportView.qml b/ExportView.qml index 2696495..46853fa 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -267,7 +267,7 @@ Item { horizontalAlignment: Text.AlignHCenter color: "#fff" font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Heading Accessible.name: text @@ -284,7 +284,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter text: "--" - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Indicator Accessible.name: text @@ -317,7 +317,7 @@ Item { horizontalAlignment: Text.AlignHCenter color: "#fff" font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Heading Accessible.name: text @@ -334,7 +334,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter text: "-- --" - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Indicator Accessible.name: text @@ -367,7 +367,7 @@ Item { horizontalAlignment: Text.AlignHCenter color: "#fff" font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily Accessible.role: Accessible.Heading Accessible.name: text @@ -385,7 +385,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter text: Singletons.Strings.notAvailableWithPaths - font.family: notoRegular + font.family: defaultFontFamily Accessible.ignored: mapViewPlus.geometryType !== Singletons.Constants.kMultipath Accessible.role: Accessible.Indicator @@ -401,7 +401,7 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter text: "Tiles: -- Size: --" - font.family: notoRegular + font.family: defaultFontFamily Accessible.ignored: mapViewPlus.geometryType === Singletons.Constants.kMultipath Accessible.role: Accessible.Indicator @@ -622,7 +622,7 @@ Item { textFormat: Text.RichText text: (!exporting) ? Singletons.Strings.createTilePackage : Singletons.Strings.create font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } ProgressIndicator { @@ -703,7 +703,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.cancel font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { diff --git a/HistoryView.qml b/HistoryView.qml index d3374c0..91e47c3 100644 --- a/HistoryView.qml +++ b/HistoryView.qml @@ -92,7 +92,7 @@ Item { Layout.fillWidth: true text: Singletons.Strings.exportHistory font.pointSize: Singletons.Config.mediumFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily verticalAlignment: Text.AlignVCenter } Rectangle { @@ -117,7 +117,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.deleteHistory font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { @@ -234,7 +234,7 @@ Item { Layout.fillWidth: true text: Singletons.Strings.uploadHistory font.pointSize: Singletons.Config.mediumFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily verticalAlignment: Text.AlignVCenter } Rectangle { @@ -259,7 +259,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.deleteHistory font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { diff --git a/MapViewPlus/GeoSearch.qml b/MapViewPlus/GeoSearch.qml index 4b749c5..f6959b3 100644 --- a/MapViewPlus/GeoSearch.qml +++ b/MapViewPlus/GeoSearch.qml @@ -278,7 +278,7 @@ Rectangle { color: Singletons.Colors.darkGray font { - family: notoRegular + family: defaultFontFamily pointSize: Singletons.Config.smallFontSizePoint } } @@ -289,7 +289,7 @@ Rectangle { color: Singletons.Colors.darkGray font { - family: notoRegular + family: defaultFontFamily pointSize: Singletons.Config.xSmallFontSizePoint } } diff --git a/MapViewPlus/MapDrawingMenu.qml b/MapViewPlus/MapDrawingMenu.qml index 214cc0c..ea54972 100644 --- a/MapViewPlus/MapDrawingMenu.qml +++ b/MapViewPlus/MapDrawingMenu.qml @@ -275,7 +275,7 @@ Rectangle{ textFormat: Text.RichText text: name font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } } } diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 51a9bb7..6df03e4 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -500,7 +500,7 @@ Item { text: Singletons.Strings.viewingFeatureXofX.arg(geoJsonHelper.currentFeature + 1).arg(geoJsonHelper.numberOfFeatures) color: Singletons.Colors.darkGray font.pointSize: Singletons.Config.xSmallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily wrapMode: Text.Wrap } } @@ -554,7 +554,7 @@ Item { anchors.fill: parent verticalAlignment: Text.AlignVCenter text: Singletons.Strings.saveAsGeojson - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.smallFontSizePoint elide: Text.ElideRight color: app.info.properties.mainButtonBorderColor @@ -616,7 +616,7 @@ Item { anchors.fill: parent verticalAlignment: Text.AlignVCenter text: Singletons.Strings.clearAllData - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.smallFontSizePoint elide: Text.ElideRight color: "red" @@ -777,7 +777,7 @@ Item { Text { id: drawingNotice anchors.fill: parent - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.xSmallFontSizePoint verticalAlignment: Text.AlignVCenter wrapMode: Text.Wrap @@ -1468,7 +1468,7 @@ Item { text: qsTr("Enter a title") verticalAlignment: Text.AlignVCenter font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } } } @@ -1523,7 +1523,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.cancel font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { @@ -1553,7 +1553,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.create font.pointSize: Singletons.Config.smallFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { @@ -1649,7 +1649,7 @@ Item { anchors.fill: parent verticalAlignment: Text.AlignVCenter text: name - font.family: notoRegular + font.family: defaultFontFamily font.pointSize: Singletons.Config.smallFontSizePoint elide: Text.ElideRight color: app.info.properties.mainButtonFontColor diff --git a/OperationSelectionView.qml b/OperationSelectionView.qml index 99cf744..74c9cef 100644 --- a/OperationSelectionView.qml +++ b/OperationSelectionView.qml @@ -112,7 +112,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.upload font.pointSize: Singletons.Config.largeFontSizePoint * .8 - font.family: notoRegular + font.family: defaultFontFamily font.capitalization: Font.AllUppercase } } @@ -127,7 +127,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.localTilePackage font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } } Item { @@ -202,7 +202,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.create font.pointSize: Singletons.Config.largeFontSizePoint * .8 - font.family: notoRegular + font.family: defaultFontFamily font.capitalization: Font.AllUppercase } } @@ -217,7 +217,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.newTilePackage font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } } Item { @@ -292,7 +292,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.browse font.pointSize: Singletons.Config.largeFontSizePoint * .8 - font.family: notoRegular + font.family: defaultFontFamily font.capitalization: Font.AllUppercase } } @@ -307,7 +307,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.organizationTilePackages font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } } Item { diff --git a/Portal/BuiltInSignInView.qml b/Portal/BuiltInSignInView.qml index 7c84343..610a51f 100755 --- a/Portal/BuiltInSignInView.qml +++ b/Portal/BuiltInSignInView.qml @@ -33,7 +33,7 @@ FocusScope { property alias username: usernameField.text property alias password: passwordField.text property bool hideCancel: false - property string fontFamily: notoRegular + property string fontFamily: defaultFontFamily signal rejected() diff --git a/Portal/PortalSettingsPage.qml b/Portal/PortalSettingsPage.qml index af09521..620f2e4 100644 --- a/Portal/PortalSettingsPage.qml +++ b/Portal/PortalSettingsPage.qml @@ -41,7 +41,7 @@ Rectangle { property bool showAuthentication: false - property string fontFamily: notoRegular + property string fontFamily: defaultFontFamily color: "white" diff --git a/Portal/PortalSignInView.qml b/Portal/PortalSignInView.qml index 3765c91..fa80d2c 100644 --- a/Portal/PortalSignInView.qml +++ b/Portal/PortalSignInView.qml @@ -55,7 +55,7 @@ Rectangle { property int buttonHeight: 35 * AppFramework.displayScaleFactor - property string fontFamily: notoRegular + property string fontFamily: defaultFontFamily signal accepted() signal rejected() @@ -405,7 +405,7 @@ Rectangle { anchors.fill: parent username: portal.username - fontFamily: notoRegular.family + fontFamily: defaultFontFamily.family onRejected: { signInView.rejected(); diff --git a/ProgressIndicator/ProgressIndicator.qml b/ProgressIndicator/ProgressIndicator.qml index a625f20..a460ddc 100644 --- a/ProgressIndicator/ProgressIndicator.qml +++ b/ProgressIndicator/ProgressIndicator.qml @@ -114,7 +114,7 @@ Rectangle { minimumPointSize: statusTextMinimumFontSize text: "" font.pointSize: statusTextFontSize - font.family: notoRegular + font.family: defaultFontFamily onLinkActivated: { Qt.openUrlExternally(link); } diff --git a/SettingsView.qml b/SettingsView.qml index 7072b82..f2c37d8 100644 --- a/SettingsView.qml +++ b/SettingsView.qml @@ -154,7 +154,7 @@ Item { color: Singletons.Colors.formElementFontColor textFormat: Text.RichText font { - family: notoRegular + family: defaultFontFamily pointSize: Singletons.Config.baseFontSizePoint } onLinkActivated: { @@ -214,7 +214,7 @@ Item { textFormat: Text.RichText text: qsTr("Reset to default") font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { searchQueryTextField.text = app.defaultSearchQuery; @@ -247,7 +247,7 @@ Item { textFormat: Text.RichText text: qsTr("Update") font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { app.servicesSearchQuery = searchQueryTextField.text; diff --git a/StatusIndicator.qml b/StatusIndicator.qml index f9aae53..cf9d5f6 100644 --- a/StatusIndicator.qml +++ b/StatusIndicator.qml @@ -87,7 +87,7 @@ Rectangle { textFormat: Text.RichText text: "" font.pointSize: statusTextFontSize - font.family: notoRegular + font.family: defaultFontFamily wrapMode: Text.WordWrap lineHeight: narrowLineHeight ? .7 : 1 onLinkActivated: { diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index d17ad27..df75c48 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -14,7 +14,7 @@ * */ -import QtQuick 2.7 +import QtQuick 2.9 //------------------------------------------------------------------------------ import ArcGIS.AppFramework 1.0 //------------------------------------------------------------------------------ @@ -36,10 +36,7 @@ App { property bool useIconFont: Qt.platform.os !== "windows" ? true : false property string icons: _icons.status == FontLoader.Ready ? _icons.name : "tilepackage" - property string notoRegular: _notoRegular.status == FontLoader.Ready ? _notoRegular.name : Qt.application.font.family - property string notoBold: _notoBold.status == FontLoader.Ready ? _notoBold.name : Qt.application.font.family - property string notoItalic: _notoItalic.status == FontLoader.Ready ? _notoItalic.name : Qt.application.font.family - property string notoBoldItalic: _notoBoldItalic.status == FontLoader.Ready ? _notoBoldItalic.name : Qt.application.font.family + property string defaultFontFamily: Qt.application.font.family property bool allowAllLevels: app.settings.boolValue(Singletons.Constants.kAllowAllZoomLevels, false) property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false) @@ -112,23 +109,6 @@ App { //-------------------------------------------------------------------------- - FontLoader { - id: _notoRegular - source: "fonts/NotoSans-Regular.ttf" - } - FontLoader { - id: _notoBold - source: "fonts/NotoSans-Bold.ttf" - } - FontLoader { - id: _notoItalic - source: "fonts/NotoSans-Italic.ttf" - } - FontLoader { - id: _notoBoldItalic - source: "fonts/NotoSans-BoldItalic.ttf" - } - FontLoader { id: _icons source: "fonts/tilepackage.ttf" diff --git a/UploadView.qml b/UploadView.qml index 2aaa013..83cb4b7 100644 --- a/UploadView.qml +++ b/UploadView.qml @@ -167,7 +167,7 @@ Item { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pointSize: Singletons.Config.largeFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } Text { Layout.fillWidth: true @@ -176,7 +176,7 @@ Item { color: Singletons.Colors.boldUIElementFontColor horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - font.family: notoRegular + font.family: defaultFontFamily } Rectangle { Layout.fillWidth: true @@ -203,7 +203,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.browseForFile font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { resetProperties(); @@ -245,7 +245,7 @@ Item { Layout.preferredHeight: selectedTPK.height / 4 text: "filename.tpk" fontSizeMode: Text.Fit - font.family: notoRegular + font.family: defaultFontFamily minimumPointSize: Singletons.Config.smallFontSizePoint color: Singletons.Colors.boldUIElementFontColor font.pointSize: Singletons.Config.largeFontSizePoint @@ -288,7 +288,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.useDifferentFile font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { fileAcceptedForUpload = false; @@ -415,7 +415,7 @@ Item { textFormat: Text.RichText text: uploading ? ( tpkPackage.aborted ? Singletons.Strings.cancelling : Singletons.Strings.uploading ): Singletons.Strings.upload font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } ProgressIndicator{ @@ -465,7 +465,7 @@ Item { textFormat: Text.RichText text: Singletons.Strings.cancel font.pointSize: Singletons.Config.baseFontSizePoint - font.family: notoRegular + font.family: defaultFontFamily } onClicked: { diff --git a/appinfo.json b/appinfo.json index 2fdc19c..7f1d6e2 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 9, + "micro": 10, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 30ed711..4da3fe4 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522812593000, + "modified": 1522815142000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 47, + "numComments": 48, "numRatings": 0, - "numViews": 255, + "numViews": 261, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860092, + "size": 860097, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 470b5629405b036a77bf0b5e9080234133f8adfc Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 14:34:22 +1000 Subject: [PATCH 20/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index 7f1d6e2..99a51ab 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 10, + "micro": 11, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 4da3fe4..fc5c43f 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522815142000, + "modified": 1522816450000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 48, + "numComments": 49, "numRatings": 0, - "numViews": 261, + "numViews": 264, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860097, + "size": 860025, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From b638d8139cc310454f2116a2b5712e921f9518c3 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 16:08:41 +1000 Subject: [PATCH 21/29] Updated copyright year --- AboutDialog/AboutDialog.qml | 2 +- AppMetrics/HockeyApp.qml | 2 +- AppToolBar.qml | 2 +- BrowseOrgView.qml | 2 +- DeepLinkingRequest/DeepLinkingRequest.qml | 2 +- DeepLinkingRequest/TilePackageDeepLinkRequest.qml | 2 +- MapViewPlus/GeoSearch.qml | 2 +- MapViewPlus/MapDrawingMenu.qml | 2 +- MapViewPlus/MapView.qml | 2 +- MapViewPlus/MapViewPlus.qml | 2 +- ProgressIndicator/ProgressIndicator.qml | 2 +- README.md | 2 +- StatusIndicator.qml | 2 +- TilePackage/TilePackageGetPKInfo.qml | 2 +- singletons/Config.qml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/AboutDialog/AboutDialog.qml b/AboutDialog/AboutDialog.qml index 4f44187..38f43cc 100644 --- a/AboutDialog/AboutDialog.qml +++ b/AboutDialog/AboutDialog.qml @@ -81,7 +81,7 @@ Dialog { } AboutText { - text: "Copyright © 2016 Esri Inc. All Rights Reserved" + text: "Copyright © 2018 Esri Inc. All Rights Reserved" } AboutText { diff --git a/AppMetrics/HockeyApp.qml b/AppMetrics/HockeyApp.qml index a20b7d0..3eb8fbc 100644 --- a/AppMetrics/HockeyApp.qml +++ b/AppMetrics/HockeyApp.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/AppToolBar.qml b/AppToolBar.qml index 7a1277d..2d725ae 100644 --- a/AppToolBar.qml +++ b/AppToolBar.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BrowseOrgView.qml b/BrowseOrgView.qml index 4d2e2a4..9963a3f 100644 --- a/BrowseOrgView.qml +++ b/BrowseOrgView.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/DeepLinkingRequest/DeepLinkingRequest.qml b/DeepLinkingRequest/DeepLinkingRequest.qml index 808b8f3..6bbf37d 100644 --- a/DeepLinkingRequest/DeepLinkingRequest.qml +++ b/DeepLinkingRequest/DeepLinkingRequest.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/DeepLinkingRequest/TilePackageDeepLinkRequest.qml b/DeepLinkingRequest/TilePackageDeepLinkRequest.qml index 2b6103f..e9856a5 100644 --- a/DeepLinkingRequest/TilePackageDeepLinkRequest.qml +++ b/DeepLinkingRequest/TilePackageDeepLinkRequest.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/MapViewPlus/GeoSearch.qml b/MapViewPlus/GeoSearch.qml index f6959b3..2d0c5c8 100644 --- a/MapViewPlus/GeoSearch.qml +++ b/MapViewPlus/GeoSearch.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/MapViewPlus/MapDrawingMenu.qml b/MapViewPlus/MapDrawingMenu.qml index ea54972..3a8dede 100644 --- a/MapViewPlus/MapDrawingMenu.qml +++ b/MapViewPlus/MapDrawingMenu.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/MapViewPlus/MapView.qml b/MapViewPlus/MapView.qml index 3640eeb..c46e71b 100644 --- a/MapViewPlus/MapView.qml +++ b/MapViewPlus/MapView.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 6df03e4..29ce927 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ProgressIndicator/ProgressIndicator.qml b/ProgressIndicator/ProgressIndicator.qml index a460ddc..91073c4 100644 --- a/ProgressIndicator/ProgressIndicator.qml +++ b/ProgressIndicator/ProgressIndicator.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 14a8681..7f4b4eb 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines ## Copyright and License -Copyright © 2016 Esri Inc. +Copyright © 2018 Esri Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/StatusIndicator.qml b/StatusIndicator.qml index cf9d5f6..2ee75e3 100644 --- a/StatusIndicator.qml +++ b/StatusIndicator.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TilePackage/TilePackageGetPKInfo.qml b/TilePackage/TilePackageGetPKInfo.qml index 6b9c753..70d6561 100644 --- a/TilePackage/TilePackageGetPKInfo.qml +++ b/TilePackage/TilePackageGetPKInfo.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/singletons/Config.qml b/singletons/Config.qml index 4901750..f6ec4fe 100644 --- a/singletons/Config.qml +++ b/singletons/Config.qml @@ -1,4 +1,4 @@ -/* Copyright 2016 Esri +/* Copyright 2018 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From eb9e1b2d90ba3919437c6a26d50b041f4a650fda Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 4 Apr 2018 16:11:09 +1000 Subject: [PATCH 22/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index 99a51ab..2da4681 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 11, + "micro": 12, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index fc5c43f..873dbc6 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522816450000, + "modified": 1522822178000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 49, + "numComments": 50, "numRatings": 0, - "numViews": 264, + "numViews": 267, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860025, + "size": 859114, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 2a25e029f77685bc47ba8610aa6ca7478f4c08a2 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 5 Apr 2018 11:28:03 +1000 Subject: [PATCH 23/29] #60 Fixed issue with extension case sensitivity, also now test for possible mismatch between projections in .prj and .shp --- MapViewPlus/MapViewPlus.qml | 12 ++++---- MapViewPlus/shapeFileToGeoJSON.js | 50 +++++++++++++++++-------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/MapViewPlus/MapViewPlus.qml b/MapViewPlus/MapViewPlus.qml index 29ce927..06cd8a2 100644 --- a/MapViewPlus/MapViewPlus.qml +++ b/MapViewPlus/MapViewPlus.qml @@ -829,12 +829,11 @@ Item { for (var x = 0; x < drop.urls.length; x++) { var url = drop.urls[x].toString(); - var fileType = url.substr(url.length-4, 4); - if (fileType === ".prj") { + if (url.search(/.prj$/gi) > -1) { projectionFilePath = url; } - if (fileType === ".shp") { + if (url.search(/.shp$/gi) > -1) { shapeFilePath = url; } } @@ -871,8 +870,6 @@ Item { coordinateSystem = ""; return; } - - console.log(coordinateSystem); } } @@ -1290,7 +1287,7 @@ Item { //-------------------------------------------------------------------------- - MapPolyline{ + MapPolyline { id: drawnPolyline line.width: sf(3) line.color: drawnExtentOutlineColor @@ -1298,7 +1295,7 @@ Item { //-------------------------------------------------------------------------- - MapPolygon{ + MapPolygon { id: drawnPolygon color: drawingExtentFillColor border.width: sf(2) @@ -1750,6 +1747,7 @@ Item { } if (messageObject.hasOwnProperty("error")){ drawingError("Error: %1".arg(messageObject.error.message)); + busyIndicator.visible = false; } if (messageObject.hasOwnProperty("status")){ workerScriptProgressIndicator.progressText = messageObject.status; diff --git a/MapViewPlus/shapeFileToGeoJSON.js b/MapViewPlus/shapeFileToGeoJSON.js index 5d6ac87..4d6ca6d 100644 --- a/MapViewPlus/shapeFileToGeoJSON.js +++ b/MapViewPlus/shapeFileToGeoJSON.js @@ -48,23 +48,13 @@ WorkerScript.onMessage = function(shapeFile) { } function establishSpatialReference(minx, miny, maxx, maxy){ - console.log("establishSpatialReference") - // the shape file .prj file was other than 3857 or 4326, so attempt // to see if it is lat / lon or web mercator type values. // its highly unlikely a web mercator projection will fall within // the following parameters, - if (minx > 180 - || minx < -180 - || maxx > 180 - || maxx < -180 - || miny > 90 - || miny < -90 - || maxy > 90 - || maxy < -90) { - + if (minx > 180 || minx < -180 || maxx > 180 || maxx < -180 || miny > 90 || miny < -90 || maxy > 90 || maxy < -90) { return "3857"; } else { @@ -184,11 +174,13 @@ function shapefileByteArrayToGeoJson(byteArray) { WorkerScript.sendMessage({"error": e}); } finally { + resetFeatures(); return; } } shapeValue = shpDataArray.getInt32(shpHeader.shape_type.position, shpHeader.shape_type.bigEndian); + shapeType = shapeTypes[shapeValue]; geoJson["shapefile_related"]["byteLength"] = shapeFileByteLength; geoJson["shapefile_related"]["shapeType"] = shapeValue; @@ -197,12 +189,13 @@ function shapefileByteArrayToGeoJson(byteArray) { if (shapeValue !== 3 && shapeValue !== 5) { try { - throw new Error("This tool currently only supports polygons and polylines."); + throw new Error("This tool currently only supports polygons and polylines. Not %1".arg(shapeType.esri)); } catch(e) { WorkerScript.sendMessage({"error": e}); } finally { + resetFeatures(); return; } } @@ -219,11 +212,24 @@ function shapefileByteArrayToGeoJson(byteArray) { var boundingBoxYMax = shpDataArray.getFloat64(shpHeader.ymax.position, shpHeader.ymax.bigEndian); geoJson["bbox"][3] = boundingBoxYMax; - if (geoJson["crs"]["properties"]["name"] === "") { - geoJson["crs"]["properties"]["name"] = establishSpatialReference(boundingBoxXMin, boundingBoxXMin, boundingBoxXMax, boundingBoxYMax); + var sniffedSpatialReference = establishSpatialReference(boundingBoxXMin, boundingBoxYMin, boundingBoxXMax, boundingBoxYMax); + + if (geoJson["crs"]["properties"]["name"] > "" && geoJson["crs"]["properties"]["name"] !== sniffedSpatialReference.toString()){ + try { + throw new Error("Possible spatial reference mismatch. SR in .prj file doesn't seem to match coordinates found in .shp file."); + } + catch(e) { + WorkerScript.sendMessage({"error": e}); + } + finally { + resetFeatures(); + return; + } } - shapeType = shapeTypes[shapeValue]; + if (geoJson["crs"]["properties"]["name"] === "") { + geoJson["crs"]["properties"]["name"] = sniffedSpatialReference; + } // geometry entries start at 100 after shape file header ------------------- cursor = 100; @@ -235,17 +241,17 @@ function shapefileByteArrayToGeoJson(byteArray) { } } - console.log(JSON.stringify(geoJson)); + //console.log(JSON.stringify(geoJson)); WorkerScript.sendMessage({"geojson": geoJson}); - return geoJson; + resetFeatures(); } function getFeature(thisCursor){ - console.log("getFeature: ", thisCursor); + //console.log("getFeature: ", thisCursor); var currentFeature = {}; partsArray = []; @@ -283,22 +289,21 @@ function getFeature(thisCursor){ thisCursor += 4; - if (currentFeature["shapefile_related"]["numParts"] > 500) { + if (currentFeature["shapefile_related"]["numParts"] > 1000) { try { - throw new Error("This tool only supports shapefiles with less than 500 parts."); + throw new Error("This tool only supports shapefiles with less than 1000 parts."); } catch(e) { WorkerScript.sendMessage({"error": e}); } finally { + resetFeatures(); return; } } if (currentFeature["shapefile_related"]["numParts"] > 0) { - - try { WorkerScript.sendMessage({"status": qsTr("Reading %1 features.".arg(featureCount))}); @@ -362,6 +367,7 @@ function getFeature(thisCursor){ } catch(e) { WorkerScript.sendMessage({"error": e}); + resetFeatures(); } } From 5ab25cf3e4ff0c4d863d74f7a41bfd1b37ebc2fb Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Thu, 5 Apr 2018 11:28:42 +1000 Subject: [PATCH 24/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index 2da4681..d553141 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 12, + "micro": 13, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 873dbc6..9e9bcc2 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522822178000, + "modified": 1522891711000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 50, + "numComments": 51, "numRatings": 0, - "numViews": 267, + "numViews": 274, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 859114, + "size": 859185, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From dded2e965ba668cc82b2fbfee348fdf0247739e1 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Fri, 6 Apr 2018 15:53:03 +1000 Subject: [PATCH 25/29] #70 Removed winrt check --- Portal/PortalSignInView.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Portal/PortalSignInView.qml b/Portal/PortalSignInView.qml index fa80d2c..fdba5b6 100644 --- a/Portal/PortalSignInView.qml +++ b/Portal/PortalSignInView.qml @@ -50,8 +50,7 @@ Rectangle { readonly property string messageCodePasswordExired: "LLS_0002" - readonly property bool hasWebView: !(Qt.platform.os == "winrt") //|| Qt.platform.os == "winphone") - readonly property bool useOAuth: hasWebView && portal.supportsOAuth + readonly property bool useOAuth: portal.supportsOAuth property int buttonHeight: 35 * AppFramework.displayScaleFactor From 7de626a512d53a68963c9b8ac5fd3b627e946cc7 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Fri, 6 Apr 2018 15:54:03 +1000 Subject: [PATCH 26/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index d553141..9273236 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 13, + "micro": 14, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 9e9bcc2..8c98914 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -24,11 +24,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522891711000, + "modified": 1522994032000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 51, + "numComments": 52, "numRatings": 0, - "numViews": 274, + "numViews": 279, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +37,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 859185, + "size": 860051, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 4fd2e637eaa000729d461e1b7a035f6995414fd1 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Wed, 9 May 2018 11:51:25 +1000 Subject: [PATCH 27/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index 9273236..e809945 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 14, + "micro": 28, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 8c98914..0d9ab2a 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -14,6 +14,7 @@ "documentation": null, "extent": [ ], + "groupDesignations": null, "guid": null, "id": "561a8441825441349a3b1ad23fdaea75", "industries": [ @@ -24,11 +25,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1522994032000, + "modified": 1525830662000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 52, + "numComments": 65, "numRatings": 0, - "numViews": 279, + "numViews": 316, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -37,7 +38,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860051, + "size": 860052, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [ From 18555bd23e61fd13f2467378f953c2863055cb1c Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Fri, 11 May 2018 14:24:26 +1000 Subject: [PATCH 28/29] #72 #67 Gallery will refresh after change in settings, Settings is disabled in Export view --- AvailableServicesModel.qml | 7 +++++++ AvailableServicesView.qml | 20 +++++++++++++++----- ExportView.qml | 2 +- SettingsView.qml | 1 + TilePackageKreator.qml | 5 +++++ 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/AvailableServicesModel.qml b/AvailableServicesModel.qml index fdd1b7a..4f4e3f4 100644 --- a/AvailableServicesModel.qml +++ b/AvailableServicesModel.qml @@ -69,6 +69,13 @@ Item { signal serviceAdded() signal serviceNotAdded() + + function reset(){ + tileServiceCount = 0; + tileServiceSum = 0; + requests = []; + } + // COMPONENTS ////////////////////////////////////////////////////////////// PortalSearch { diff --git a/AvailableServicesView.qml b/AvailableServicesView.qml index 52d1ed2..79cf8fa 100644 --- a/AvailableServicesView.qml +++ b/AvailableServicesView.qml @@ -91,11 +91,7 @@ Item { // SIGNAL IMPLEMENTATIONS ////////////////////////////////////////////////// Component.onCompleted: { - asm.getAvailableServices.start(); - activityIndicator.visible = true; - rotator.target = refreshSpinner; - refreshSpinner.visible = true; - rotator.start(); + getServices(); } //-------------------------------------------------------------------------- @@ -107,6 +103,20 @@ Item { mainView.appToolBar.historyButtonEnabled = true; mainView.appToolBar.settingsButtonEnabled = true; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage + if (settingsChanged) { + asm.reset(); + servicesStatusText.text = Singletons.Strings.queryingServices; + getServices(); + settingsChanged = false; + } + } + + function getServices(){ + asm.getAvailableServices.start(); + activityIndicator.visible = true; + rotator.target = refreshSpinner; + refreshSpinner.visible = true; + rotator.start(); } // UI ////////////////////////////////////////////////////////////////////// diff --git a/ExportView.qml b/ExportView.qml index 46853fa..ab2da98 100644 --- a/ExportView.qml +++ b/ExportView.qml @@ -84,7 +84,7 @@ Item { mainView.appToolBar.backButtonEnabled = true; mainView.appToolBar.backButtonVisible = true; mainView.appToolBar.historyButtonEnabled = true; - mainView.appToolBar.settingsButtonEnabled = true; + mainView.appToolBar.settingsButtonEnabled = false; mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage } diff --git a/SettingsView.qml b/SettingsView.qml index f2c37d8..143cafd 100644 --- a/SettingsView.qml +++ b/SettingsView.qml @@ -35,6 +35,7 @@ Item { // SIGNAL IMPLEMENTATIONS ////////////////////////////////////////////////// StackView.onActivating: { + app.settingsChanged = false; mainView.appToolBar.enabled = true; mainView.appToolBar.settingsButtonEnabled = false; mainView.appToolBar.historyButtonEnabled = true; diff --git a/TilePackageKreator.qml b/TilePackageKreator.qml index df75c48..cda5f39 100644 --- a/TilePackageKreator.qml +++ b/TilePackageKreator.qml @@ -38,6 +38,7 @@ App { property string icons: _icons.status == FontLoader.Ready ? _icons.name : "tilepackage" property string defaultFontFamily: Qt.application.font.family + property bool settingsChanged: false property bool allowAllLevels: app.settings.boolValue(Singletons.Constants.kAllowAllZoomLevels, false) property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false) property bool timeoutNonResponsiveServices: app.settings.boolValue(Singletons.Constants.kTimeOutUnresponsiveServices, true) @@ -71,18 +72,22 @@ App { } onTimeoutNonResponsiveServicesChanged: { + settingsChanged = true; app.settings.setValue(Singletons.Constants.kTimeOutUnresponsiveServices, timeoutNonResponsiveServices); } onTimeoutValueChanged: { + settingsChanged = true; app.settings.setValue(Singletons.Constants.kTimeOutValue, timeoutValue); } onServicesSearchQueryChanged: { + settingsChanged = true; app.settings.setValue(Singletons.Constants.kSearchQueryString, servicesSearchQuery); } onIncludeCurrentUserInSearchChanged: { + settingsChanged = true; app.settings.boolValue(Singletons.Constants.kIncludeCurrentUserInSearch, includeCurrentUserInSearch); } From 9168568eab4065c9984747ff656ba55958c42468 Mon Sep 17 00:00:00 2001 From: Jayson Ward Date: Fri, 11 May 2018 14:26:20 +1000 Subject: [PATCH 29/29] Updated online --- appinfo.json | 2 +- iteminfo.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appinfo.json b/appinfo.json index e809945..f03b479 100644 --- a/appinfo.json +++ b/appinfo.json @@ -101,7 +101,7 @@ "urlScheme": "arcgis-tilepackage", "version": { "major": 1, - "micro": 28, + "micro": 29, "minor": 3 } } diff --git a/iteminfo.json b/iteminfo.json index 0d9ab2a..18410f4 100644 --- a/iteminfo.json +++ b/iteminfo.json @@ -25,11 +25,11 @@ "largeThumbnail": null, "licenseInfo": "\n


", "listed": false, - "modified": 1525830662000, + "modified": 1526012760000, "name": "561a8441825441349a3b1ad23fdaea75.zip", - "numComments": 65, + "numComments": 66, "numRatings": 0, - "numViews": 316, + "numViews": 320, "owner": "appstudio_apps", "ownerFolder": null, "properties": null, @@ -38,7 +38,7 @@ "scoreCompleteness": 65, "screenshots": [ ], - "size": 860052, + "size": 859238, "snippet": "Tile package creation tool.", "spatialReference": null, "tags": [