ArcGIS Maps SDK for Kotlin offers a toolkit, ArcGIS Maps SDK for Kotlin Toolkit, that contains composable UI components to help simplify your Android development work. For information on how Android Jetpack Compose works, see Get started with Jetpack Compose.
The Geo
module has composable components to display maps and scenes. Most apps that use Android Jetpack Compose will need this module.
- GeoView-Compose Provides composable implementations of the
Map
andView Scene
classes.View
The Toolkit contains other, special-purpose composable components:
- Authenticator - Displays a user interface when network and ArcGIS authentication challenges occur.
- Compass - Shows a compass direction when the map is rotated. Auto-hides when the map points north.
- FeatureForm - Enables users to edit field values of features in a layer using the FeatureForm API that has been configured externally.
- FloorFilter - Allows filtering of floor plan data in a geo view by a site, a building in the site, or a floor in the building.
The fastest way to get the toolkit into your app is to reference the compiled library (.aar file) from Jfrog, as described below. For instructions on using the toolkit from source code — for example, if you want to customize it — see Developer setup in the toolkit's repo.
Issues resolved in 200.4
- Authenticator: OAuth sessions should not transfer between external chrome browser and the app.
- FloorFilter:
Floor
causes app crash if theFilter Map
used to create theFloor
is notFilter State Floor
.Aware
Modular toolkit library
The toolkit has library modules that can be deployed independent of each other in an application. Note that an individual library module can contain one or more composable UI components.
Reference the library from Jfrog
-
If you haven't already, install and set up ArcGIS Maps SDK for Kotlin.
-
Ensure the Esri public Jfrog Maven repository is in your project's gradle file,
https:
//esri.jfrog.io/artifactory/arcgis settings.gradle.kts (Project Settings)Use dark colors for code blocks dependencyResolutionManagement { repositories { ... maven { url = uri("https://esri.jfrog.io/artifactory/arcgis") } ... } }
-
Add the toolkit dependencies to the module-level gradle build script. Specify only the toolkit components that you will use in your app. For example:
build.gradle.kts (Module: app)Use dark colors for code blocks dependencies { . . . // ArcGIS Maps for Kotlin - SDK dependency implementation("com.esri:arcgis-maps-kotlin:200.4.0") // Toolkit dependencies implementation("com.esri:arcgis-maps-kotlin-toolkit-geoview-compose:200.4.0") // Additional modules from Toolkit, if needed, such as: // implementation("com.esri:arcgis-maps-kotlin-toolkit-authentication:200.4.0") . . . }
Artifact versioning (Alternative)
In the code above, Toolkit dependencies specify their artifact version. Alternatively, you can rely on the Toolkit's BOM (Bill of Materials), which specifies versions of the individual toolkit components that are compatible with each other. You can see these version numbers by examining the BOM's .pom file. For more information, see the toolkit repo's top-level README. Note that the Toolkit BOM itself has a version number.
Gradle Version Catalogs are the state-of-the-art way to manage dependency versions. A file named
gradle/libs.versions.toml
declares a variable for each dependency's Maven name and variables for version numbers. All dependencies can be declared here, including Toolkit BOM, Toolkit modules, ArcGIS Maps SDK for Kotlin, Kotlin libraries, and Android libraries. In recent releases of Android Studio, the New Project wizard creates that file for you.Modified to use the Toolkit BOM, the
build.gradle.kts
code looks as follows. Note that the variables, such aslibs.arcgis.map.kotlin.toolkit.bom
andlibs.arcgis.maps.kotlin.toolkit.geoview.compose
, do not specify their version, sincegradle/libs.versions.toml
manages versions.Use dark colors for code blocks // ArcGIS Maps for Kotlin - SDK dependency implementation(libs.arcgis.maps.kotlin) // Toolkit dependencies implementation(platform(libs.arcgis.maps.kotlin.toolkit.bom)) implementation(libs.arcgis.maps.kotlin.toolkit.geoview.compose) // Additional modules from Toolkit, if needed, such as: // implementation(libs.arcgis.maps.kotlin.toolkit.authentication)
Build from source
Use the following code if you want to customize the toolkit.
$ ./gradlew clean assembleDebug --info
See the setup instructions for a more detailed guide.
Requirements
The following table shows version compatibility.
SDK Version | Toolkit Version |
---|---|
200.0.0 | none |
200.1.0 | none |
200.2.0 | 200.2.0 |
200.3.0 | 200.3.0 |
200.4.0 | 200.4.0 |
Issues
Find a bug or want to request a new feature enhancement? Please let us know by submitting an issue.