Skip to content

Commit

Permalink
Merge pull request #78 from Esri/issue77
Browse files Browse the repository at this point in the history
Issue77
  • Loading branch information
Jayson Ward committed Jun 26, 2018
2 parents dfe2c0e + 4cac78e commit b7531b7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
37 changes: 33 additions & 4 deletions ExportView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,16 @@ Item {
mainView.appToolBar.backButtonVisible = true;
mainView.appToolBar.historyButtonEnabled = true;
mainView.appToolBar.settingsButtonEnabled = false;
mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage
mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.createNewTilePackage;
}

StackView.onActivated: {
mapViewPlus.mapTileService = currentTileService.url;
mapViewPlus.mapTileServiceUsesToken = currentTileService.useTokenToAccess;
}

StackView.onDeactivating: {
mapViewPlus.mapClearData();
}

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -140,7 +149,7 @@ Item {
// MAP SECTION /////////////////////////////////////////////////

Rectangle {
color: "#fff"
color:"#fff"
Layout.fillWidth: true
Layout.fillHeight: true

Expand All @@ -155,14 +164,13 @@ Item {
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
enabled: map !== null && map.mapReady

mapViewPlusPortal: exportView.portal
mapDefaultLat: app.info.properties.mapDefaultLat
mapDefaultLong: app.info.properties.mapDefaultLong
mapDefaultZoomLevel: (calledFromAnotherApp && dlr.zoomLevel !== null) ? dlr.zoomLevel : app.info.properties.mapDefaultZoomLevel
mapDefaultCenter: (calledFromAnotherApp && dlr.center !== null) ? dlr.center : {"lat": app.info.properties.mapDefaultLat, "long": app.info.properties.mapDefaultLong }
mapTileService: currentTileService.url
mapTileServiceUsesToken: currentTileService.useTokenToAccess

Component.onCompleted: {
zoomLevelIndicator.text = "%1".arg(parseFloat(mapViewPlus.map.zoomLevel).toFixed(1));
Expand Down Expand Up @@ -190,6 +198,9 @@ Item {
}

onDrawingStarted: {
if (!map.mapReady){
return;
}
}

onDrawingFinished: {
Expand Down Expand Up @@ -230,6 +241,22 @@ Item {
}
}
}

Rectangle {
anchors.fill: parent
color: "#333"
visible: mapViewPlus.map === null || !mapViewPlus.map.mapReady
Text {
anchors.fill: parent
anchors.margins: sf(20)
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("Error Loading Map Service: %1".arg(currentTileService.url))
font.pointSize: 18
color: "#fff"
}
}
}

// MAP TOOL BAR ////////////////////////////////////////
Expand Down Expand Up @@ -442,6 +469,8 @@ Item {
onChangeTileService: {
exportView.currentTileIndex = index;
exportView.currentTileService = availableServices.get(index);
mapViewPlus.mapTileService = exportView.currentTileService.url;
mapViewPlus.mapTileServiceUsesToken = exportView.currentTileService.useTokenToAccess;
}

onExportZoomLevelsChanged: {
Expand Down
37 changes: 4 additions & 33 deletions HistoryView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,9 @@ Item {
property bool exportHistoryExists: false
property bool uploadHistoryExists: false

// property var xHistory
// property var uHistory


// SIGNAL IMPLEMENTATIONS //////////////////////////////////////////////////

Component.onCompleted: {
// xHistory = appDatabase.read("SELECT * FROM 'exports' ORDER BY OBJECTID DESC");
getExportHistory();
getUploadHistory();
}

//--------------------------------------------------------------------------
Expand All @@ -56,6 +49,10 @@ Item {
mainView.appToolBar.backButtonVisible = true;
mainView.appToolBar.toolBarTitleLabel = Singletons.Strings.exportAndUploadHistory;
}
StackView.onActivated: {
getExportHistory();
getUploadHistory();
}

// UI //////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -145,32 +142,6 @@ Item {
Layout.fillHeight: true
Layout.fillWidth: true

// ListView {
// id: exportListView
// width: parent.width
// height: parent.height
// clip: true
// flickableDirection: Flickable.VerticalFlick
// model: xHistory
// spacing: sf(5)
// delegate: Rectangle {
// width: parent.width
// height: childrenRect.height
// color: "gold"
// Column{
// anchors.fill: parent
// Text {
// width: parent.width
// text: title
// }
// Text {
// width: parent.width
// text: new Date(transaction_date).toLocaleDateString() + " " + new Date(transaction_date).toLocaleTimeString()
// }
// }
// }
// }

Flickable {
id: exportFlickable
anchors.fill: parent
Expand Down
10 changes: 1 addition & 9 deletions MapViewPlus/MapView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ Item {
name: "ArcGIS.mapping.mapTypes.mapSources"
value: internal.mapSources
}

// PluginParameter {
// id: pluginMaxZoomLevel
// name: "ArcGIS.mapping.maximumZoomLevel"
// value: exportDetails.maxLevels
// }
}

center: QtPositioning.coordinate(defaultCenter.lat,defaultCenter.long)
Expand All @@ -103,14 +97,12 @@ Item {
}

gesture.onFlickStarted: {
console.log('flick started');
}

gesture.onPinchStarted: {
console.log('pinch started');
}

Component.onCompleted: {
clearData();
}

onZoomLevelChanged: {
Expand Down
10 changes: 9 additions & 1 deletion MapViewPlus/MapViewPlus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ Item {
anchors.fill: parent
defaultCenter: mapDefaultCenter
defaultZoomLevel: mapDefaultZoomLevel
mapService: mapTileService
mapService: mapTileService !== null ? mapTileService : ""
useToken: mapTileServiceUsesToken
z: 50000
focus: !drawing
Expand Down Expand Up @@ -2117,5 +2117,13 @@ Item {
userBookmarks = appDatabase.read("SELECT * FROM 'bookmarks' WHERE user IS '%1'".arg(portal.user.email));
}

//--------------------------------------------------------------------------

function mapClearData(){
if (map.mapReady && map !== null) {
map.clearData();
}
}

// END /////////////////////////////////////////////////////////////////////
}

0 comments on commit b7531b7

Please sign in to comment.