Skip to content

Rename - Compose MapView #165

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 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
4 changes: 2 additions & 2 deletions microapps/LocationDisplayApp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Location Display Micro-app

This micro-app demonstrates the use of `LocationDisplay` with a composable `Map`.
This micro-app demonstrates the use of `LocationDisplay` with a composable `MapView`.

![Screenshot](screenshot.png)

Expand All @@ -9,4 +9,4 @@ This micro-app demonstrates the use of `LocationDisplay` with a composable `Map`
The application starts with a `LocationDisplay` set up and started. Use the switch in the app bar to start/stop the location display.
Use the overflow action button in the app bar to choose between different `LocationDisplayAutoPanMode` options.

For more information on the composable `Map` component and how it works, see it's [Readme](../../toolkit/geo-compose/README.md).
For more information on the composable `MapView` component and how it works, see it's [Readme](../../toolkit/geo-compose/README.md).
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ import com.arcgismaps.location.LocationDisplayAutoPanMode
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.mapping.view.LocationDisplay
import com.arcgismaps.toolkit.geocompose.Map
import com.arcgismaps.toolkit.geocompose.MapView
import com.arcgismaps.toolkit.geocompose.rememberLocationDisplay
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

/**
* Displays a composable [com.arcgismaps.toolkit.geocompose.Map] with a [LocationDisplay] obtained
* Displays a composable [com.arcgismaps.toolkit.geocompose.MapView] with a [LocationDisplay] obtained
* with [rememberLocationDisplay].
* The location display can be started/stopped using a [Switch].
* If the location display fails to start, an error message is displayed below the switch.
Expand Down Expand Up @@ -125,7 +125,7 @@ fun MainScreen() {
)
},
) { innerPadding ->
Map(
MapView(
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.toolkit.geocompose.Map
import com.arcgismaps.toolkit.geocompose.MapView

@Composable
fun MainScreen() {
val arcGISMap by remember { mutableStateOf(ArcGISMap(BasemapStyle.ArcGISStreets)) }
Map(
MapView(
modifier = Modifier.fillMaxSize(),
arcGISMap = arcGISMap,
arcGISMap = arcGISMap
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapView
/**
* A compose equivalent of the [MapView].
*
* @param modifier Modifier to be applied to the Map
* @param modifier Modifier to be applied to the composable MapView
* @param arcGISMap the [ArcGISMap] to be rendered by this composable
* @param locationDisplay the [LocationDisplay] used by the composable [com.arcgismaps.toolkit.geocompose.Map]
* @param mapViewInteractionOptions the [MapViewInteractionOptions] used by this composable [com.arcgismaps.toolkit.geocompose.Map]
* @param onViewpointChanged lambda invoked when the viewpoint of the Map has changed
* @param overlay the composable overlays to display on top of the Map. Example, a compass, floorfilter etc.
* @param locationDisplay the [LocationDisplay] used by the composable [com.arcgismaps.toolkit.geocompose.MapView]
* @param mapViewInteractionOptions the [MapViewInteractionOptions] used by this composable [com.arcgismaps.toolkit.geocompose.MapView]
* @param onViewpointChanged lambda invoked when the viewpoint of the composable MapView has changed
* @param overlay the composable overlays to display on top of the composable MapView. Example, a compass, floorfilter etc.
* @since 200.3.0
*/
@Composable
public fun Map(
public fun MapView(
modifier: Modifier = Modifier,
arcGISMap: ArcGISMap? = null,
locationDisplay: LocationDisplay = rememberLocationDisplay(),
Expand All @@ -68,7 +68,7 @@ public fun Map(
val mapView = remember { MapView(context) }

Box(modifier = Modifier.semantics {
contentDescription = "MapContainer"
contentDescription = "MapViewContainer"
}) {
AndroidView(modifier = modifier
.semantics {
Expand Down Expand Up @@ -129,6 +129,6 @@ public inline fun rememberLocationDisplay(

@Preview
@Composable
internal fun MapPreview() {
Map()
internal fun MapViewPreview() {
MapView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview

@Composable
public fun Scene() {
public fun SceneView() {
// Todo implementation...
Text("Implement Scene here! ")
Text("Implement SceneView here! ")
}

@Preview
@Composable
internal fun ScenePreview() {
Scene()
internal fun SceneViewPreview() {
SceneView()
}