Skip to content

Commit cf675ae

Browse files
authored
Compose Map InteractionOptions (#163)
1 parent 2c1d7ad commit cf675ae

File tree

1 file changed

+9
-0
lines changed
  • toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose

1 file changed

+9
-0
lines changed

toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/Map.kt

+9
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@ import com.arcgismaps.ArcGISEnvironment
3535
import com.arcgismaps.mapping.ArcGISMap
3636
import com.arcgismaps.mapping.view.LocationDisplay
3737
import com.arcgismaps.mapping.view.MapView
38+
import com.arcgismaps.mapping.view.MapViewInteractionOptions
3839
import kotlinx.coroutines.launch
3940

41+
/**
42+
* The default instance of [MapViewInteractionOptions]
43+
*/
44+
public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapViewInteractionOptions()
45+
4046
/**
4147
* A compose equivalent of the [MapView].
4248
*
4349
* @param modifier Modifier to be applied to the Map
4450
* @param arcGISMap the [ArcGISMap] to be rendered by this composable
4551
* @param locationDisplay the [LocationDisplay] used by the composable [com.arcgismaps.toolkit.geocompose.Map]
52+
* @param mapViewInteractionOptions the [MapViewInteractionOptions] used by this composable [com.arcgismaps.toolkit.geocompose.Map]
4653
* @param onViewpointChanged lambda invoked when the viewpoint of the Map has changed
4754
* @param overlay the composable overlays to display on top of the Map. Example, a compass, floorfilter etc.
4855
* @since 200.3.0
@@ -52,6 +59,7 @@ public fun Map(
5259
modifier: Modifier = Modifier,
5360
arcGISMap: ArcGISMap? = null,
5461
locationDisplay: LocationDisplay = rememberLocationDisplay(),
62+
mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptionDefaults,
5563
onViewpointChanged: (() -> Unit)? = null,
5664
overlay: @Composable () -> Unit = {}
5765
) {
@@ -69,6 +77,7 @@ public fun Map(
6977
factory = { mapView },
7078
update = {
7179
it.map = arcGISMap
80+
it.interactionOptions = mapViewInteractionOptions
7281
it.locationDisplay = locationDisplay
7382
})
7483

0 commit comments

Comments
 (0)