Welcome back up in the main activity.
Then remove these greetings.
Now let's create our composable.
So remove the scaffold.
And inside this theme we need to define our composable.
I'll name it as Uber Clone map.
Let's start with this composable.
So inside Kotlin Plus Java, this package create a new package named as screens inside the screens.
Create a new Kotlin file.
Name it as Uber clone.
Inside this file, create a new composable function named as Uber Clone map.
Since we're gonna include our map, some overlays, and the screen, um, contains the map, the expandable
fabs, some buttons, some scale bars, and other widgets.
We're gonna include them inside a box layout.
This box layout has a modifier dot fill maximum size.
Inside this box, we're gonna include our map.
So this is the first widget Google map.
And as we learned before Google Map composable function, you can specify some attributes like the modifier
modifier dot fill maximum size.
You can set the width and the size as you want.
The camera position we can set it and the properties like explaining the or changing the map style options.
If you need more parameters, click on the Google Map decoration.
You can set the modifier descendants, camera position, state content, local location, source UI
settings map, click map location and button click and others.
Okay, so this is the Google Map declaration.
Now we are interested in the camera position state.
So let me create here in this Uber clue, the camera position state equals to remember camera position
state.
The remember camera position state function is a part of Google Maps compose library.
It's used to manage the camera position.
The view of a Google map in Jetpack Compose.
The purpose of using such a function is to track and control the map's camera state.
The state position.
State means position.
Zoom, tilt, burning, and so on.
Allowing programmatic updates to the map view.
Moving the camera to the new location also.
It observes user interactions when the user pans.
Zoom the map and other gestures.
Gestures.
Okay, so this is how we use the camera position.
We need to control the camera position programmatically.
So I use this variable.
Let me define this camera position.
So camera position state equals to camera position state.
You can define other properties like map style if you prefer any uh, any uh any style or any map style.
But for now, we're good.
I'm gonna use the default Google map style.