Skip to content

Commit

Permalink
feat: Change the position parameter of MarkerState to a clearer name.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSpiner authored and smith.jspiner committed Nov 4, 2024
1 parent f7f4854 commit 2aa9d4a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ public class MarkerState private constructor(position: LatLng) {
/**
* Creates a new [MarkerState] object
*
* @param position the initial marker position
* @param initialPosition the initial marker position
*/
@StateFactoryMarker
public operator fun invoke(
position: LatLng = LatLng(0.0, 0.0)
): MarkerState = MarkerState(position)
initialPosition: LatLng = LatLng(0.0, 0.0)
): MarkerState = MarkerState(initialPosition)

/**
* The default saver implementation for [MarkerState]
Expand All @@ -182,13 +182,15 @@ public class MarkerState private constructor(position: LatLng) {
* Other use cases may be better served syncing [MarkerState.position] with a data model.
*
* This cannot be used to preserve info window visibility across configuration changes.
*
* @param initialPosition the initial marker position
*/
@Composable
public fun rememberMarkerState(
key: String? = null,
position: LatLng = LatLng(0.0, 0.0)
initialPosition: LatLng = LatLng(0.0, 0.0)
): MarkerState = rememberSaveable(key = key, saver = MarkerState.Saver) {
MarkerState(position)
MarkerState(initialPosition)
}

/**
Expand Down

0 comments on commit 2aa9d4a

Please sign in to comment.