Toolkit

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 GeoView-Compose 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 MapView and SceneView classes.

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: FloorFilter causes app crash if the Map used to create the FloorFilterState is not FloorAware.

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

  1. If you haven't already, install and set up ArcGIS Maps SDK for Kotlin.

  2. 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
    1
    2
    3
    4
    5
    6
    7
    dependencyResolutionManagement {
    	repositories {
    		...
    		 maven { url = uri("https://esri.jfrog.io/artifactory/arcgis") }
    		...
    	}
    }
  3. 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
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    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 as libs.arcgis.map.kotlin.toolkit.bom and libs.arcgis.maps.kotlin.toolkit.geoview.compose, do not specify their version, since gradle/libs.versions.toml manages versions.

    Expand
    Use dark colors for code blocks
    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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
        // 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)
    
    Expand

Build from source

Use the following code if you want to customize the toolkit.

Use dark colors for code blocksCopy
1
$ ./gradlew clean assembleDebug --info

See the setup instructions for a more detailed guide.

Requirements

The following table shows version compatibility.

SDK VersionToolkit Version
200.0.0none
200.1.0none
200.2.0200.2.0
200.3.0200.3.0
200.4.0200.4.0

Issues

Find a bug or want to request a new feature enhancement? Please let us know by submitting an issue.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.