Skip to content

Configure a GeoView

The Jetpack Compose-enabled geoview-compose library makes it easy to configure the MapView and SceneView composables from the ArcGIS Maps SDK for Kotlin using @Composable functions. These components allow you to manage the appearance, behavior, and event handling of your map and scene views declaratively using parameters or lambda functions.

  • Appearance: Modify attributes like background grids, atmospheric effects, or selection properties.
  • Behavior: Enable features such as location display or gesture handling.
  • Events: Capture user interactions, such as taps, with callback lambdas.

GeoView Compose configurations

The Jetpack Compose-enabled geoview-compose library is designed to simplify configuring maps and scenes. They fall into the following three primary roles:

Change appearance

These configurations update how your map or scene looks:

  • Wraparound mode (wrapAroundMode): Enables continuous panning across the international date line.
  • Background grid (backgroundGrid): Configures gridlines behind your map.
  • Atmosphere effect (atmosphereEffect): Sets visual effects for sky simulation in a scene.
  • Selection properties (selectionProperties): Changes color settings for selected features.
Use dark colors for code blocksCopy
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
76
77
78
79
80
81
82
83
84
85
86
        MapView(
            arcGISMap = map,
            wrapAroundMode = WrapAroundMode.EnabledWhenSupported,
            backgroundGrid = BackgroundGrid(color = Color.cyan),
            selectionProperties = SelectionProperties(color = Color.red),
            modifier = Modifier
                .fillMaxSize()
                .weight(1f)
                .animateContentSize(),

        )

Note:

  • Use the Compose modifier parameter to allow you to decorate or augment the GeoView composables.
  • See the Compose tutorial Style a feature layer to learn how to apply renderers and label definitions to a feature layer based on attribute values.
  • See the sample app Show realistic light and shadows to learn how to show realistic lighting and shadows for a given time of day.

Control behavior

These configurations define how users interact with your GeoView:

  • Enable location display with locationDisplay.
  • Add geometry editing functionality via geometryEditor.
  • Customize interaction options using mapViewInteractionOptions.
Use dark colors for code blocksCopy
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
        MapView(
            arcGISMap = map,
            locationDisplay = rememberLocationDisplay(),
            geometryEditor = GeometryEditor(),
            mapViewInteractionOptions = MapViewInteractionOptions(isPanEnabled = false)
        )

Note:

  • See the Compose tutorial Display device location to learn how to display the current device location on a map or scene.
  • See the sample app Show device location using fused location data source to learn how to use the Fused Location Provider and Fused Orientation Provider to implement an ArcGIS Maps SDK Custom Location Data Source Location Provider.
  • See the sample app Snap geometry edits to learn how to use the Geometry Editor to edit a geometry and align it to existing geometries on a map.

Capture events

Event-related configurations handle user interactions or changes in state:

  • Detect gestures like single/double taps (onSingleTapConfirmed, onDoubleTap).
  • Capture navigation events such as rotation (onRotate) or scaling (onScale).
  • Observe layer load status changes with callbacks like onLayerViewStateChanged.

These event-based configuration names often start with "on" to indicate trigger actions. For example, onMapRotationChanged and onSpatialReferenceChanged.

Use dark colors for code blocksCopy
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
        MapView(
            arcGISMap = map,
            onSingleTapConfirmed = { tapEvent -> /* Handle tap */ },
            onRotate = { rotationEvent -> /* Handle rotation */ },
            onDrawStatusChanged = { drawStatus -> /* Respond to drawing updates */ }
        )

Note:

  • See the sample app Show callout to learn how to show a callout with the latitude and longitude of user-tapped points.
  • See the sample app Show scale bar to learn how to add a scale bar to visually gauge distances on a map.
  • See the sample app Display overview map to learn how to include an overview or inset map as an additional map view to show the wider context of the primary view.

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