I took one of the Feature Editing samples, and changed it so it's purely offline because for my use the user will never be editing the server directly. In the morning they will generate a new geodatabase while connected to our internal wifi, then go into the field and make edits, and then sync edits back at the office while connected to our internal wifi.
The problem I'm having is that after the geodatabase is generated, the Feature Layer is not added to the map! If I close the app and reopen it, then the layer is visible, but the replica is no longer attached for syncing.
How can I get the Feature Layers to load AFTER the geodatabase is generated? Thanks
<SPAN class="comment token">// Copyright 2015 ESRI</SPAN>
<SPAN class="comment token">// All rights reserved under the copyright laws of the United States</SPAN>
<SPAN class="comment token">// and applicable international laws, treaties, and conventions.</SPAN>
<SPAN class="comment token">// You may freely redistribute and use this sample code, with or</SPAN>
<SPAN class="comment token">// without modification, provided you include the original copyright</SPAN>
<SPAN class="comment token">// notice and use restrictions.</SPAN>
<SPAN class="comment token">// See the Sample code usage restrictions document for further information.</SPAN>
<SPAN class="keyword token">import</SPAN> QtQuick <SPAN class="number token">2.3</SPAN>
<SPAN class="keyword token">import</SPAN> QtQuick<SPAN class="punctuation token">.</SPAN>Controls <SPAN class="number token">1.2</SPAN>
<SPAN class="keyword token">import</SPAN> QtQuick<SPAN class="punctuation token">.</SPAN>Controls<SPAN class="punctuation token">.</SPAN>Styles <SPAN class="number token">1.2</SPAN>
<SPAN class="keyword token">import</SPAN> ArcGIS<SPAN class="punctuation token">.</SPAN>Runtime <SPAN class="number token">10.26</SPAN>
<SPAN class="keyword token">import</SPAN> ArcGIS<SPAN class="punctuation token">.</SPAN>Extras <SPAN class="number token">1.0</SPAN>
<SPAN class="keyword token">import</SPAN> QtPositioning <SPAN class="number token">5.7</SPAN>
ApplicationWindow <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> appWindow
width<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">800</SPAN>
height<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">600</SPAN>
title<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Tree Trimming"</SPAN>
property real scaleFactor<SPAN class="punctuation token">:</SPAN> System<SPAN class="punctuation token">.</SPAN>displayScaleFactor
property int fontSize<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">15</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
property string featuresUrl<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"my/feature/service"</SPAN>
property string gdbPath<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"~/ArcGIS/Runtime/Data/Test/offlineSample.geodatabase"</SPAN>
property <SPAN class="keyword token">var</SPAN> selectedFeatureId<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">null</SPAN>
Envelope <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> initialExtent
spatialReference<SPAN class="punctuation token">:</SPAN> map<SPAN class="punctuation token">.</SPAN>spatialReference
xMin<SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">13821343.454522012</SPAN>
yMin<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5631086.281941083</SPAN>
xMax<SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">13732523.627654603</SPAN>
yMax<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5754761.393706545</SPAN>
<SPAN class="punctuation token">}</SPAN>
Map <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> map
anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent
focus<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
extent<SPAN class="punctuation token">:</SPAN> initialExtent
ArcGISTiledMapServiceLayer <SPAN class="punctuation token">{</SPAN>
url<SPAN class="punctuation token">:</SPAN> <SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FCanvas%2FWorld_Light_Gray_Base%2FMapServer" target="_blank">http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer</A><SPAN>"</SPAN></SPAN>
<SPAN class="punctuation token">}</SPAN>
FeatureLayer <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> offlineLayer
featureTable<SPAN class="punctuation token">:</SPAN> local
selectionColor<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"cyan"</SPAN>
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">hitTestFeatures</SPAN><SPAN class="punctuation token">(</SPAN>x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> tolerance <SPAN class="operator token">=</SPAN> Qt<SPAN class="punctuation token">.</SPAN>platform<SPAN class="punctuation token">.</SPAN>os <SPAN class="operator token">===</SPAN> <SPAN class="string token">"ios"</SPAN>
<SPAN class="operator token">||</SPAN> Qt<SPAN class="punctuation token">.</SPAN>platform<SPAN class="punctuation token">.</SPAN>os <SPAN class="operator token">===</SPAN> <SPAN class="string token">"android"</SPAN> <SPAN class="operator token">?</SPAN> <SPAN class="number token">4</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN>
<SPAN class="keyword token">var</SPAN> featureIds <SPAN class="operator token">=</SPAN> offlineLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">findFeatures</SPAN><SPAN class="punctuation token">(</SPAN>
x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">,</SPAN> tolerance <SPAN class="operator token">*</SPAN> scaleFactor<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>featureIds<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
selectedFeatureId <SPAN class="operator token">=</SPAN> featureIds<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="token function">selectFeature</SPAN><SPAN class="punctuation token">(</SPAN>selectedFeatureId<SPAN class="punctuation token">)</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Tap anywhere to move the feature"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
onMouseClicked<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>offlineLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">isFeatureSelected</SPAN><SPAN class="punctuation token">(</SPAN>selectedFeatureId<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> featureToEdit <SPAN class="operator token">=</SPAN> offlineLayer<SPAN class="punctuation token">.</SPAN>featureTable<SPAN class="punctuation token">.</SPAN><SPAN class="token function">feature</SPAN><SPAN class="punctuation token">(</SPAN>
selectedFeatureId<SPAN class="punctuation token">)</SPAN>
featureToEdit<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="operator token">=</SPAN> mouse<SPAN class="punctuation token">.</SPAN>mapPoint
offlineLayer<SPAN class="punctuation token">.</SPAN>featureTable<SPAN class="punctuation token">.</SPAN><SPAN class="token function">updateFeature</SPAN><SPAN class="punctuation token">(</SPAN>selectedFeatureId<SPAN class="punctuation token">,</SPAN>
featureToEdit<SPAN class="punctuation token">)</SPAN>
offlineLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">unselectFeature</SPAN><SPAN class="punctuation token">(</SPAN>selectedFeatureId<SPAN class="punctuation token">)</SPAN>
selectedFeatureId <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">null</SPAN>
syncButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Tap on Sync to update the Feature Service with the edits"</SPAN>
<SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN>
offlineLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitTestFeatures</SPAN><SPAN class="punctuation token">(</SPAN>mouse<SPAN class="punctuation token">.</SPAN>x<SPAN class="punctuation token">,</SPAN> mouse<SPAN class="punctuation token">.</SPAN>y<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
GeodatabaseFeatureTable <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> local
geodatabase<SPAN class="punctuation token">:</SPAN> gdb<SPAN class="punctuation token">.</SPAN>valid <SPAN class="operator token">?</SPAN> gdb <SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">null</SPAN>
featureServiceLayerId<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN>
<SPAN class="punctuation token">}</SPAN>
ServiceInfoTask <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> serviceInfoTask
url<SPAN class="punctuation token">:</SPAN> featuresUrl
onFeatureServiceInfoStatusChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>featureServiceInfoStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>FeatureServiceInfoStatusCompleted<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//statusText.text = "Service info received. Tap on the Generate Geodatabase Button"</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> gdb<SPAN class="punctuation token">.</SPAN>valid
generateButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN>
<SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>featureServiceInfoStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>FeatureServiceInfoStatusErrored<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Error:"</SPAN> <SPAN class="operator token">+</SPAN> errorString
generateButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
cancelButton<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Start Over"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
SyncGeodatabaseParameters <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> syncGeodatabaseParameters
syncDirection<SPAN class="punctuation token">:</SPAN> Enums<SPAN class="punctuation token">.</SPAN>SyncDirectionBidirectional
<SPAN class="punctuation token">}</SPAN>
Feature <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> featureToEdit
<SPAN class="punctuation token">}</SPAN>
Rectangle <SPAN class="punctuation token">{</SPAN>
anchors <SPAN class="punctuation token">{</SPAN>
fill<SPAN class="punctuation token">:</SPAN> controlsColumn
margins<SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">10</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
<SPAN class="punctuation token">}</SPAN>
color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"lightgrey"</SPAN>
radius<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
border<SPAN class="punctuation token">.</SPAN>color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"black"</SPAN>
opacity<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.77</SPAN>
MouseArea <SPAN class="punctuation token">{</SPAN>
anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent
onClicked<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">(</SPAN>mouse<SPAN class="punctuation token">.</SPAN>accepted <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Column <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> controlsColumn
anchors <SPAN class="punctuation token">{</SPAN>
left<SPAN class="punctuation token">:</SPAN> parent<SPAN class="punctuation token">.</SPAN>left
top<SPAN class="punctuation token">:</SPAN> parent<SPAN class="punctuation token">.</SPAN>top
margins<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">20</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
<SPAN class="punctuation token">}</SPAN>
spacing<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">7</SPAN>
Button <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> generateButton
text<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Generate Geodatabase"</SPAN>
enabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">false</SPAN>
style<SPAN class="punctuation token">:</SPAN> ButtonStyle <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> Text <SPAN class="punctuation token">{</SPAN>
text<SPAN class="punctuation token">:</SPAN> control<SPAN class="punctuation token">.</SPAN>text
color<SPAN class="punctuation token">:</SPAN> control<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">?</SPAN> <SPAN class="string token">"black"</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"grey"</SPAN>
horizontalAlignment<SPAN class="punctuation token">:</SPAN> Text<SPAN class="punctuation token">.</SPAN>AlignHCenter
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
onClicked<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
generateGeodatabaseParameters<SPAN class="punctuation token">.</SPAN><SPAN class="token function">initialize</SPAN><SPAN class="punctuation token">(</SPAN>
serviceInfoTask<SPAN class="punctuation token">.</SPAN>featureServiceInfo<SPAN class="punctuation token">)</SPAN>
generateGeodatabaseParameters<SPAN class="punctuation token">.</SPAN>extent <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN>extent
generateGeodatabaseParameters<SPAN class="punctuation token">.</SPAN>returnAttachments <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Starting generate geodatabase task"</SPAN>
geodatabaseSyncTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">generateGeodatabase</SPAN><SPAN class="punctuation token">(</SPAN>
generateGeodatabaseParameters<SPAN class="punctuation token">,</SPAN> gdbPath<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Button <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> syncButton
text<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Sync"</SPAN>
width<SPAN class="punctuation token">:</SPAN> generateButton<SPAN class="punctuation token">.</SPAN>width
enabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">false</SPAN>
style<SPAN class="punctuation token">:</SPAN> generateButton<SPAN class="punctuation token">.</SPAN>style
onClicked<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
geodatabaseSyncTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">syncGeodatabase</SPAN><SPAN class="punctuation token">(</SPAN>syncGeodatabaseParameters<SPAN class="punctuation token">,</SPAN>
gdb<SPAN class="punctuation token">)</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Starting sync task"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Button <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> cancelButton
text<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Cancel"</SPAN>
width<SPAN class="punctuation token">:</SPAN> generateButton<SPAN class="punctuation token">.</SPAN>width
enabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">false</SPAN>
style<SPAN class="punctuation token">:</SPAN> generateButton<SPAN class="punctuation token">.</SPAN>style
onClicked<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
geodatabaseSyncTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">cancelJob</SPAN><SPAN class="punctuation token">(</SPAN>syncStatusInfo<SPAN class="punctuation token">)</SPAN>
enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Cancel"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Geodatabase <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> gdb
path<SPAN class="punctuation token">:</SPAN> gdbPath
<SPAN class="punctuation token">}</SPAN>
GeodatabaseSyncStatusInfo <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> syncStatusInfo
<SPAN class="punctuation token">}</SPAN>
GeodatabaseSyncTask <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> geodatabaseSyncTask
url<SPAN class="punctuation token">:</SPAN> featuresUrl
onGenerateStatusChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>generateStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>GenerateStatusCompleted<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> geodatabasePath
cancelButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
generateButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Select a feature"</SPAN>
<SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>generateStatus <SPAN class="operator token">===</SPAN> GeodatabaseSyncTask<SPAN class="punctuation token">.</SPAN>GenerateError<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Error: "</SPAN> <SPAN class="operator token">+</SPAN> generateGeodatabaseError<SPAN class="punctuation token">.</SPAN>message
<SPAN class="operator token">+</SPAN> <SPAN class="string token">" Code= "</SPAN> <SPAN class="operator token">+</SPAN> generateGeodatabaseError<SPAN class="punctuation token">.</SPAN>code<SPAN class="punctuation token">.</SPAN><SPAN class="token function">toString</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">" "</SPAN> <SPAN class="operator token">+</SPAN> generateGeodatabaseError<SPAN class="punctuation token">.</SPAN>details
generateButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
cancelButton<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Start Over"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
onGeodatabaseSyncStatusInfoChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>status <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>GeodatabaseStatusUploadingDelta<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> deltaProgress <SPAN class="operator token">=</SPAN> geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>deltaUploadProgress <SPAN class="operator token">/</SPAN> <SPAN class="number token">1000</SPAN>
<SPAN class="keyword token">var</SPAN> deltaSize <SPAN class="operator token">=</SPAN> geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>deltaSize <SPAN class="operator token">/</SPAN> <SPAN class="number token">1000</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>statusString <SPAN class="operator token">+</SPAN> <SPAN class="string token">" "</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="token function">String</SPAN><SPAN class="punctuation token">(</SPAN>
deltaProgress<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">" of "</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="token function">String</SPAN><SPAN class="punctuation token">(</SPAN>
deltaSize<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">" KBs..."</SPAN>
<SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>statusString <SPAN class="operator token">+</SPAN> <SPAN class="string token">"..."</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>status <SPAN class="operator token">!==</SPAN> GeodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>Cancelled<SPAN class="punctuation token">)</SPAN>
cancelButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN>
syncStatusInfo<SPAN class="punctuation token">.</SPAN>json <SPAN class="operator token">=</SPAN> geodatabaseSyncStatusInfo<SPAN class="punctuation token">.</SPAN>json
<SPAN class="punctuation token">}</SPAN>
onSyncStatusChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>syncStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>SyncStatusCompleted<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
cancelButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
syncButton<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Sync completed. You may continue editing the features."</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>syncStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>SyncStatusErrored<SPAN class="punctuation token">)</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Error: "</SPAN> <SPAN class="operator token">+</SPAN> syncGeodatabaseError<SPAN class="punctuation token">.</SPAN>message
<SPAN class="operator token">+</SPAN> <SPAN class="string token">" Code= "</SPAN> <SPAN class="operator token">+</SPAN> syncGeodatabaseError<SPAN class="punctuation token">.</SPAN>code<SPAN class="punctuation token">.</SPAN><SPAN class="token function">toString</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">" "</SPAN> <SPAN class="operator token">+</SPAN> syncGeodatabaseError<SPAN class="punctuation token">.</SPAN>details
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
GenerateGeodatabaseParameters <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> generateGeodatabaseParameters
<SPAN class="punctuation token">}</SPAN>
Rectangle <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> textStatusRectangle
anchors <SPAN class="punctuation token">{</SPAN>
fill<SPAN class="punctuation token">:</SPAN> statusText
margins<SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">10</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
<SPAN class="punctuation token">}</SPAN>
visible<SPAN class="punctuation token">:</SPAN> statusText<SPAN class="punctuation token">.</SPAN>text<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN>
color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"lightgrey"</SPAN>
radius<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5</SPAN>
border<SPAN class="punctuation token">.</SPAN>color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"black"</SPAN>
opacity<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.77</SPAN>
<SPAN class="punctuation token">}</SPAN>
Text <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> statusText
anchors <SPAN class="punctuation token">{</SPAN>
left<SPAN class="punctuation token">:</SPAN> parent<SPAN class="punctuation token">.</SPAN>left
right<SPAN class="punctuation token">:</SPAN> parent<SPAN class="punctuation token">.</SPAN>right
bottom<SPAN class="punctuation token">:</SPAN> parent<SPAN class="punctuation token">.</SPAN>bottom
margins<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">20</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
<SPAN class="punctuation token">}</SPAN>
wrapMode<SPAN class="punctuation token">:</SPAN> Text<SPAN class="punctuation token">.</SPAN>WordWrap
color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"black"</SPAN>
<SPAN class="punctuation token">}</SPAN>
Rectangle <SPAN class="punctuation token">{</SPAN>
anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent
color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"transparent"</SPAN>
border <SPAN class="punctuation token">{</SPAN>
width<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.5</SPAN> <SPAN class="operator token">*</SPAN> scaleFactor
color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"black"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Component<SPAN class="punctuation token">.</SPAN>onCompleted<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
statusText<SPAN class="punctuation token">.</SPAN>text <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Getting service info"</SPAN>
serviceInfoTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">fetchFeatureServiceInfo</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>