Android Compose
Android Compose (Jetpack Compose) is a toolkit for creating UI in Android applications developed in Kotlin. Unlike Android View, this framework follows the declarative approach to describing the interface.
Map
The compose-map module for Android Compose by Urbi contains a standard set of UI controls for managing the map. The module is available for both Full and Map versions of the SDK.
To add the module to your application:
-
Add the following elements to
app/build.gradle
and specify the number and type of the SDK version (both parameters are mandatory):dependencies { def sdkVersion = "12.4.0" // SDK version number implementation("ru.dgis.sdk:sdk-map:$sdkVersion") // Specify sdk-map or sdk-full implementation("ru.dgis.sdk:compose-map:$sdkVersion") }
See an example of a prepared
app/build.gradle
in the demo project on GitHub. -
Get the map using MapComposable. The map is then used when adding UI elements.
See the map preparation example.
The standard set contains the following controls:
- IndoorComposable to switch floors.
- TrafficComposable to display the current traffic jam score and manage the visibility of traffic jams on the map.
- ZoomComposable to scale the map (zoom in and out).
- CompassComposable to manage the compass that shows the current map azimuth.
- MyLocationComposable to fly to the current user location. This UI control displays the current camera follow state (
CameraFollowState
) and enables changing it.