There are two types of offline apps you can build with ArcGIS Maps SDKs for Native Apps:
To learn more and choose a type of offline app, go to Types of offline apps.
2. Prepare a mobile data sourceMobile data sources provide your offline app with the data and maps that it needs to function. Examples of mobile data sources are offline maps, offline data, mobile packages, and data files. Different types of offline apps have different options for mobile data sources. You can choose from various mobile data sources that suit your type of offline app.
Partially offline apps support a wider selection of mobile data sources. This type of offline app has network access to download data, such as offline-enabled web maps to generate offline maps or data services to generate offline data.
Fully offline apps have more limited options for mobile data sources. These apps rely primarily on locally stored data, such as mobile packages authored in ArcGIS Pro or data files then sideloaded onto the device.
Refer to the chart below to prepare the correct mobile data source for your offline app.
You can build a partially offline app using offline maps, offline data, mobile packages, or data files. See the chart below to determine which mobile data source fits your app requirements best.
Full support Partial support No supportYou can build a fully offline app using mobile packages or data files. See the chart below to determine which mobile data source fits your app requirements best.
Mobile packages Data files 2D maps 1 3D scenes 2 Edit data while offline 3 Synchronize offline edits 4 Fully disconnected apps/devices Offline geocoding 5 Offline routing 6 Offline analysis Set expiration date for data access Full support Partial support No supportThe general steps to prepare a mobile data source are:
Learn more about the different types of mobile data sources in Types of mobile data sources.
3. Build the appAfter preparing a mobile data source, the next step is to create an application with ArcGIS Maps SDKs for Native Apps for your preferred platform. Your application will access the mobile data source you have prepared, and can then be expanded with additional functionalities, such as geocoding or routing.
The following examples show how to access different mobile data sources in partially offline and fully offline apps.
You can use offline maps in a partially offline app only.
ArcGIS Maps SDK for .NET ArcGIS Maps SDK for .NET ArcGIS Maps SDK for Kotlin ArcGIS Maps SDK for Swift ArcGIS Maps SDK for Java ArcGIS Maps SDK for Qt ArcGIS Maps SDK for Flutter
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var portal = await ArcGISPortal.CreateAsync();
var portalItem = await PortalItem.CreateAsync(portal, "YOUR_ITEM_ID"); // Replace with your web map ID
var map = new Map(portalItem);
OfflineMapTask offlineTask = await OfflineMapTask.CreateAsync(map);
GenerateOfflineMapParameters generateParameters =
await offlineTask.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
GenerateOfflineMapJob job = offlineTask.GenerateOfflineMap(generateParameters, "path\\to\\map\\directory");
GenerateOfflineMapResult result = await job.GetResultAsync();
if (result.OfflineMap is Map offlineMap)
{
MainMapView.Map = offlineMap;
}
Topic
Learn more in Partially offline apps > Offline maps.
You can use offline data in a partially offline app only.
ArcGIS Maps SDK for .NET ArcGIS Maps SDK for .NET ArcGIS Maps SDK for Swift ArcGIS Maps SDK for Kotlin ArcGIS Maps SDK for Java ArcGIS Maps SDK for Qt ArcGIS Maps SDK for Flutter
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
MainMapView.Map = new Map(BasemapStyle.ArcGISStreets);
var areaOfInterest = new Esri.ArcGISRuntime.Geometry.Polygon(new [] {
new MapPoint(-88.153245, 41.778064, SpatialReferences.Wgs84),
new MapPoint(-88.146708, 41.778870, SpatialReferences.Wgs84),
new MapPoint(-88.145878, 41.769764, SpatialReferences.Wgs84),
new MapPoint(-88.153431, 41.770330, SpatialReferences.Wgs84)
});
var featureServiceUri = new Uri("https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/arcgis/rest/services/WaterDistributionNetwork/FeatureServer");
GeodatabaseSyncTask geodatabaseSyncTask = await GeodatabaseSyncTask.CreateAsync(featureServiceUri);
GenerateGeodatabaseParameters gdbGenerateParameters
= await geodatabaseSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(areaOfInterest.Extent);
gdbGenerateParameters.ReturnAttachments = false;
GenerateGeodatabaseJob job = geodatabaseSyncTask.GenerateGeodatabase(gdbGenerateParameters, "path\\to\\file.geodatabase");
// Optionally listen for progress changes
job.ProgressChanged += (o,e) => { };
Geodatabase generateResult = await job.GetResultAsync();
MainMapView.Map.OperationalLayers.AddRange(
generateResult.GeodatabaseFeatureTables.Select(table => new FeatureLayer(table))
);
MainMapView.SetViewpointGeometryAsync(areaOfInterest, 50);
Tip
The example above uses feature service to generate the offline data. You can also use the basemap styles service, vector tile service, or map tile service.
TopicLearn more in Partially offline apps > Offline data.
You can use mobile packages in both partially offline and fully offline apps.
ArcGIS Maps SDK for .NET ArcGIS Maps SDK for .NET ArcGIS Maps SDK for Kotlin ArcGIS Maps SDK for Swift ArcGIS Maps SDK for Java ArcGIS Maps SDK for Qt ArcGIS Maps SDK for Flutter
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
try
{
var mobileMapPackage = await MobileMapPackage.OpenAsync(path: "path\\to\\file.mmpk");
await mobileMapPackage.LoadAsync();
MainMapView.Map = mobileMapPackage.Maps.First();
}
catch(Exception ex)
{
// Handle error.
}
Topic
Learn more in Fully offline apps > Mobile packages.
You can use data files in both partially offline and fully offline apps.
ArcGIS Maps SDK for .NET ArcGIS Maps SDK for .NET ArcGIS Maps SDK for Kotlin ArcGIS Maps SDK for Swift ArcGIS Maps SDK for Java ArcGIS Maps SDK for Qt ArcGIS Maps SDK for Flutter
Use dark colors for code blocks Copy
1
2
3
4
5
6
var shapefileTable = new ShapefileFeatureTable("\\path\\to\\shapefile.shp");
var shapefileLayer = new FeatureLayer(shapefileTable);
MainMapView.Map.OperationalLayers.Add(shapefileLayer);
Tip
The example above uses a shapefile as a data file. You can also use a mobile geodatabase or other supported data files.
TopicLearn more in Fully offline apps > Data files.
Tutorials Create an offline-enabled web mapUse Map Viewer and the ArcGIS portal to create an offline-enabled web map.
Use your portal to create an offline map area from an offline-enabled web map.
Use ArcGIS Pro to create a mobile map package.
Download and display an offline map for a custom area of a web map.
Access and display a map from a mobile map package for offline use.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4