Skip to content

Commit da7ddbb

Browse files
authored
Apply Common Design to Download Preplanned Map Area Sample (#81)
* Update the sample per the design * Create download_preplanned_map_area.png * Update readme and metadata * Rename variable * Rename method * UI updates after testing * download directory * crossAxisAlignment * text * use row * change padding * listview * remove center styling * add onTap rule * comma * separate setState * recapture image * padding * add .0 * add path separator * setState * padding
1 parent b604e60 commit da7ddbb

File tree

5 files changed

+341
-100
lines changed

5 files changed

+341
-100
lines changed

assets/generated_samples_list.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,31 @@
464464
"category": "Edit and Manage Data",
465465
"description": "Take a map offline using a preplanned map area.",
466466
"ignore": false,
467-
"images": [],
468-
"keywords": [],
467+
"images": [
468+
"download_preplanned_map_area.png"
469+
],
470+
"keywords": [
471+
"map area",
472+
"offline",
473+
"pre-planned",
474+
"preplanned",
475+
"DownloadPreplannedOfflineMapJob",
476+
"DownloadPreplannedOfflineMapParameters",
477+
"DownloadPreplannedOfflineMapResult",
478+
"OfflineMapTask",
479+
"PreplannedMapArea"
480+
],
469481
"redirect_from": [],
470-
"relevant_apis": [],
471-
"snippets": [],
482+
"relevant_apis": [
483+
"DownloadPreplannedOfflineMapJob",
484+
"DownloadPreplannedOfflineMapParameters",
485+
"DownloadPreplannedOfflineMapResult",
486+
"OfflineMapTask",
487+
"PreplannedMapArea"
488+
],
489+
"snippets": [
490+
"download_preplanned_map_area_sample.dart"
491+
],
472492
"title": "Download preplanned map area",
473493
"key": "download_preplanned_map_area"
474494
},
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Download preplanned map area
2+
3+
Take a map offline using a preplanned map area.
4+
5+
![Image of download preplanned map area](download_preplanned_map_area.png)
6+
7+
## Use case
8+
9+
Generating offline maps on demand for a specific area can be time consuming for users and a processing load on the server. If areas of interest are known ahead of time, a web map author can pre-create packages for these areas. This way, the generation only needs to happen once, making the workflow more efficient for users and servers.
10+
11+
An archeology team could define preplanned map areas for dig sites which can be taken offline for field use.
12+
13+
## How to use the sample
14+
15+
Tap the "Select Map" button to view a list of the available preplanned map areas. Tap a list item to initiate a download of the associated area. The download progress will be shown in the list. Once a download is complete, tap the list item again to display the offline map in the map view.
16+
17+
## How it works
18+
19+
1. Open the online `ArcGISMap` from a `PortalItem` and display it.
20+
2. Create an `OfflineMapTask` using the portal item.
21+
3. Get the `PreplannedMapArea`s from the task, and then load them.
22+
4. To download a selected map area, create the default `DownloadPreplannedOfflineMapParameters` from the task using the selected preplanned map area.
23+
5. Set the update mode of the preplanned map area.
24+
6. Use the parameters and a download path to create a `DownloadPreplannedOfflineMapJob` from the task.
25+
7. Start the job. Once it has completed, get the `DownloadPreplannedOfflineMapResult`.
26+
8. Get the `ArcGISMap` from the result and display it in the `ArcGISMapView`.
27+
28+
## Relevant API
29+
30+
* DownloadPreplannedOfflineMapJob
31+
* DownloadPreplannedOfflineMapParameters
32+
* DownloadPreplannedOfflineMapResult
33+
* OfflineMapTask
34+
* PreplannedMapArea
35+
36+
## About the data
37+
38+
The [Naperville stormwater network map](https://arcgisruntime.maps.arcgis.com/home/item.html?id=acc027394bc84c2fb04d1ed317aac674) is based on ArcGIS Solutions for Stormwater and provides a realistic depiction of a theoretical stormwater network.
39+
40+
## Additional information
41+
42+
`PreplannedUpdateMode` can be used to set the way the preplanned map area receives updates in several ways:
43+
44+
* `noUpdates` - No updates will be performed. This mode is intended for when a static snapshot of the data is required, and it does not create a replica. This is the mode used for this sample.
45+
* `syncWithFeatureServices` - Changes, including local edits, will be synced directly with the underlying feature services. This is the default update mode.
46+
* `downloadScheduledUpdates` - Scheduled, read-only updates will be downloaded from the online map area and applied to the local mobile geodatabases.
47+
48+
For more information about offline workflows, see [Offline maps, scenes, and data](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/offline/) in the *ArcGIS Developers* guide.
49+
50+
## Tags
51+
52+
map area, offline, pre-planned, preplanned

lib/samples/download_preplanned_map_area/README.metadata.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,30 @@
22
"category": "Edit and Manage Data",
33
"description": "Take a map offline using a preplanned map area.",
44
"ignore": false,
5-
"images": [],
6-
"keywords": [],
5+
"images": [
6+
"download_preplanned_map_area.png"
7+
],
8+
"keywords": [
9+
"map area",
10+
"offline",
11+
"pre-planned",
12+
"preplanned",
13+
"DownloadPreplannedOfflineMapJob",
14+
"DownloadPreplannedOfflineMapParameters",
15+
"DownloadPreplannedOfflineMapResult",
16+
"OfflineMapTask",
17+
"PreplannedMapArea"
18+
],
719
"redirect_from": [],
8-
"relevant_apis": [],
9-
"snippets": [],
20+
"relevant_apis": [
21+
"DownloadPreplannedOfflineMapJob",
22+
"DownloadPreplannedOfflineMapParameters",
23+
"DownloadPreplannedOfflineMapResult",
24+
"OfflineMapTask",
25+
"PreplannedMapArea"
26+
],
27+
"snippets": [
28+
"download_preplanned_map_area_sample.dart"
29+
],
1030
"title": "Download preplanned map area"
1131
}
196 KB
Loading

0 commit comments

Comments
 (0)