Skip to content

Commit 1e0350e

Browse files
committed
Merge branch 'main' into sample/Download-vector-tiles-to-local-cache
2 parents 7d03e74 + 93b682e commit 1e0350e

30 files changed

+714
-5
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ArcGIS Android Issue Template
22

3-
GitHub is **ONLY** used for issues pertaining to ArcGIS Maps SDK Kotlin Samples. Use [Esri Community](https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions) for any general ArcGIS Runtime Android SDK questions.
3+
GitHub is **ONLY** used for issues pertaining to ArcGIS Maps SDK Kotlin Samples. Use [Esri Community](https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions) for any general ArcGIS Maps SDK questions.
44

55
Is this something you can [contribute](CONTRIBUTING.md)? Send a pull request! New Samples, bug fixes and documentation fixes are welcome.
66

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Built APK's are saved to **arcgis-maps-sdk-kotlin-samples/[module-name]/build/ou
4747

4848
### Run samples through the sample viewer
4949
The samples in this repository can also be viewed in a single sample viewer app. It can be found on the Play Store or [on ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=21ac248ea189406c821400dc28bf686c). If downloading from ArcGIS Online, follow these instructions to run the app locally on your device:
50-
- Download and unzip the file to get the apk **ArcGIS_Runtime_Sample_Viewer_Android_20000.apk**.
50+
- Download and unzip the file to get the apk **ArcGIS_Maps_SDK_Sample_Viewer_Android_20000.apk**.
5151

5252
## Issues
5353

@@ -69,7 +69,7 @@ Anyone and everyone is welcome to [contribute](.github/CONTRIBUTING.md). We do a
6969
Please see our [guidelines for contributing doc](https://github.com/Esri/contributing/blob/main/README.md)
7070

7171
## Licensing
72-
Copyright 2021 Esri
72+
Copyright 2022 Esri
7373

7474
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
7575

generate-offline-map/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

generate-offline-map/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generate offline map
2+
3+
Take a web map offline.
4+
5+
![Image of generate offline map](generate-offline-map.png)
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
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"category": "Edit and Manage Data",
3+
"description": "Take a web map offline.",
4+
"formal_name": "GenerateOfflineMap",
5+
"ignore": false,
6+
"images": [
7+
"generate-offline-map.png"
8+
],
9+
"keywords": [
10+
"download",
11+
"offline",
12+
"save",
13+
"web map",
14+
"GenerateOfflineMapJob",
15+
"GenerateOfflineMapParameters",
16+
"GenerateOfflineMapResult",
17+
"OfflineMapTask",
18+
"Portal"
19+
],
20+
"language": "kotlin",
21+
"redirect_from": [
22+
"/android/latest/sample-code/generate-offline-map.htm"
23+
],
24+
"relevant_apis": [
25+
"GenerateOfflineMapJob",
26+
"GenerateOfflineMapParameters",
27+
"GenerateOfflineMapResult",
28+
"OfflineMapTask",
29+
"Portal"
30+
],
31+
"snippets": [
32+
"src/main/java/com/esri/arcgismaps/sample/generateofflinemap/MainActivity.kt"
33+
],
34+
"title": "Generate offline map"
35+
}

generate-offline-map/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'org.jetbrains.kotlin.android'
3+
4+
android {
5+
compileSdkVersion rootProject.ext.compileSdkVersion
6+
7+
defaultConfig {
8+
applicationId "com.esri.arcgismaps.sample.generateofflinemap"
9+
minSdkVersion rootProject.ext.minSdkVersion
10+
targetSdkVersion rootProject.ext.targetSdkVersion
11+
versionCode rootProject.ext.versionCode
12+
versionName rootProject.ext.versionName
13+
buildConfigField("String", "API_KEY", API_KEY)
14+
}
15+
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
23+
buildFeatures {
24+
dataBinding true
25+
viewBinding true
26+
}
27+
}
28+
29+
dependencies {
30+
// lib dependencies from rootProject build.gradle
31+
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
32+
implementation "com.google.android.material:material:$materialVersion"
33+
}
449 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.esri.arcgismaps.sample.generateofflinemap">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
7+
<application
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/AppTheme">
14+
<activity
15+
android:exported="true"
16+
android:name=".MainActivity"
17+
android:label="@string/app_name">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
26+
</manifest>

0 commit comments

Comments
 (0)