|
| 1 | +# Generate offline map |
| 2 | + |
| 3 | +Take a web map offline. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Use case |
| 8 | + |
| 9 | +Taking a web map offline allows users continued productivity when their network connectivity is poor or nonexistent. For example, by taking a map offline, a field worker inspecting utility lines in remote areas could still access a feature's location and attribute information. |
| 10 | + |
| 11 | +## How to use the sample |
| 12 | + |
| 13 | +Once the map loads, zoom to the extent you want to take offline. The red border shows the extent that will be downloaded. Tap the "Take Map Offline" button to start the offline map job. The progress bar will show the job's progress. When complete, the offline map will replace the online map in the map view. |
| 14 | + |
| 15 | +## How it works |
| 16 | + |
| 17 | +1. Create an `ArcGISMap` with a `Portal` item pointing to the web map. |
| 18 | +2. Create `GenerateOfflineMapParameters` specifying the download area geometry, minimum scale, and maximum scale. |
| 19 | +3. Create an `OfflineMapTask` with the map. |
| 20 | +4. Create the `OfflineMapJob` with `OfflineMapTask.generateOfflineMap(params, downloadDirectoryPath)` and start it with `OfflineMapJob.start()`. |
| 21 | +5. When the job is done, get the offline map with `OfflineMapJob.result.offlineMap`. |
| 22 | + |
| 23 | +## Relevant API |
| 24 | + |
| 25 | +* GenerateOfflineMapJob |
| 26 | +* GenerateOfflineMapParameters |
| 27 | +* GenerateOfflineMapResult |
| 28 | +* OfflineMapTask |
| 29 | +* Portal |
| 30 | + |
| 31 | +## About the data |
| 32 | + |
| 33 | +The map used in this sample shows the [stormwater network](https://arcgisruntime.maps.arcgis.com/home/item.html?id=acc027394bc84c2fb04d1ed317aac674) within Naperville, IL, USA, with cartography designed for web and mobile devices with offline support. |
| 34 | + |
| 35 | +## Additional information |
| 36 | + |
| 37 | +The creation of the offline map can be fine-tuned using [parameter overrides for feature layers](https://github.com/Esri/arcgis-runtime-samples-android/tree/master/java/generate-offline-map-overrides), or by using [local basemaps](https://github.com/Esri/arcgis-runtime-samples-android/tree/master/java/generate-offline-map-with-local-basemap) |
| 38 | +to achieve more customised results. |
| 39 | + |
| 40 | +## Tags |
| 41 | + |
| 42 | +download, offline, save, web map |
0 commit comments