Skip to content

Compose Map InteractionOptions #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.view.MapView
import com.arcgismaps.mapping.view.MapViewInteractionOptions

/**
* A compose equivalent of the [MapView].
Expand All @@ -43,14 +44,19 @@ import com.arcgismaps.mapping.view.MapView
public fun Map(
modifier: Modifier = Modifier,
arcGISMap: ArcGISMap? = null,
mapViewInteractionOptions: MapViewInteractionOptions? = null,
overlay: @Composable () -> Unit = {}
) {
val lifecycleOwner = LocalLifecycleOwner.current
val context = LocalContext.current
val mapView = remember { MapView(context) }.apply {
map = arcGISMap
if (mapViewInteractionOptions != null) {
interactionOptions = mapViewInteractionOptions
}
}


Box(modifier = Modifier.semantics {
contentDescription = "MapContainer"
}) {
Expand Down