Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,22 @@ class GoogleMapViewTests {
}
}

@Test
fun testCameraZoomLevels() {
assertThat(cameraPositionState.minZoomLevel).isNull()
assertThat(cameraPositionState.maxZoomLevel).isNull()

initMap()

composeTestRule.runOnUiThread {
val minZoomLevel = cameraPositionState.minZoomLevel
val maxZoomLevel = cameraPositionState.maxZoomLevel
assertThat(minZoomLevel).isNotNull()
assertThat(maxZoomLevel).isNotNull()
assertThat(minZoomLevel!!).isAtMost(maxZoomLevel!!)
}
}

@Test(expected = IllegalStateException::class)
fun testMarkerStateCannotBeReused() {
initMap {
Expand Down Expand Up @@ -314,4 +330,4 @@ class GoogleMapViewTests {

assertionBlock()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ public class CameraPositionState private constructor(
public val projection: Projection?
get() = map?.projection

/**
* The minimum zoom level for the currently bound map, or `null` if this state is not currently
* bound to a [GoogleMap].
*/
public val minZoomLevel: Float?
get() = map?.minZoomLevel

/**
* The maximum zoom level for the currently bound map, or `null` if this state is not currently
* bound to a [GoogleMap].
*/
public val maxZoomLevel: Float?
get() = map?.maxZoomLevel

/**
* Local source of truth for the current camera position.
* While [map] is non-null this reflects the current position of [map] as it changes.
Expand Down