Synchronize offline edits with a feature service.
A survey worker who works in an area without an internet connection could take a geodatabase of survey features offline at their office, make edits and add new features to the offline geodatabase in the field, and sync the updates with the online feature service after returning to the office.
Pan and zoom to position the red rectangle around the area you want to take offline. Click "Generate" to take the area offline. When complete, the offline area will be shown in the red rectangle. To edit features, click to select a feature, and click again anywhere else within the red rectangle to move the selected feature. To sync the edits with the feature service, click the "Synchronize" button.
- Create a
GeodatabaseSyncTask
from a URL to a feature service. - Use
createDefaultGenerateGeodatabaseParametersAsync()
on the geodatabase sync task to createGenerateGeodatabaseParameters
, passing in anEnvelope
extent as the parameter. - Create a
GenerateGeodatabaseJob
from theGeodatabaseSyncTask
usinggenerateGeodatabaseAsync(...)
, passing in the parameters and a path to where the geodatabase should be downloaded locally. - Start the job and get the result
Geodatabase
. - Load the geodatabase and get its feature tables. Create feature layers from the feature tables and add them to the map's operational layers collection.
- Create
SyncGeodatabaseParameters
and set the sync direction. - Create a
SyncGeodatabaseJob
fromGeodatabaseSyncTask
using.syncGeodatabaseAsync(...)
passing in the parameters and geodatabase as arguments. - Start the sync job to synchronize the edits.
- FeatureLayer
- FeatureTable
- GenerateGeodatabaseJob
- GenerateGeodatabaseParameters
- GeodatabaseSyncTask
- SyncGeodatabaseJob
- SyncGeodatabaseParameters
- SyncLayerOption
This sample downloads the following items from ArcGIS Online automatically:
- SanFrancisco.tpk - Streets Tile Package (tpk) for the City of San Francisco.
The basemap uses an offline tile package of San Francisco. The online feature service has features with wildfire information.
feature service, geodatabase, offline, synchronize