WEBVTT

00:00.080 --> 00:01.160
Welcome back.

00:01.200 --> 00:04.640
We created the project in Google Maps platform.

00:05.000 --> 00:08.960
We added the dependency in build file.

00:09.000 --> 00:18.320
Now our project is ready to use and create the Google Maps composable function inside the set content.

00:18.320 --> 00:20.240
Remove this scaffold.

00:20.480 --> 00:27.320
Also, you can remove the theme theme and start with Google Map.

00:27.360 --> 00:34.760
The Google Map composable function is part of the Maps Compose library by Google.

00:35.080 --> 00:43.520
It allows you to embed and control a Google map directly within your Jetpack Compose UI, without needing

00:43.560 --> 00:47.120
to use XML layouts or map view.

00:47.240 --> 00:52.320
The composable integrates seamlessly with other compose UI elements.

00:52.320 --> 01:01.040
If we go to this composable Ctrl and left click, we can get this Google Mapkit file.

01:01.240 --> 01:08.240
We have a lot of things we can customize with those parameters of the Google map.

01:08.280 --> 01:09.040
Declarative.

01:09.080 --> 01:14.840
You describe what the map should look like, then compose handles the rest.

01:15.120 --> 01:21.800
Customizable supports markers, polygons, polylines, camera movement, and more.

01:21.840 --> 01:29.920
Lifecycle aware handles lifecycle events automatically, so you don't need to manage the map's lifecycle

01:29.920 --> 01:30.680
manually.

01:30.720 --> 01:39.320
As usual, we'll start with those modifiers and the modifier controls the layout and sizing of the map.

01:39.320 --> 01:41.600
We can use fill maximum size.

01:41.600 --> 01:43.240
We can set the padding.

01:43.680 --> 01:53.480
The camera position state manages the map's view position, latitude, longitude, zoom, tilt, buffering,

01:53.680 --> 01:54.600
and others.

01:54.720 --> 02:02.600
So when using animate smoothly move the camera move instantly jumps to the to the position we're going

02:02.600 --> 02:03.280
to skip.

02:03.360 --> 02:11.040
Uh, the parameters that we're not, uh, they are least important and they are not very important,

02:11.040 --> 02:18.240
uh, to to discuss or use properties defines map behavior and UI settings.

02:18.400 --> 02:28.160
For example, we can set the map style you can for normal hybrid terrain shows 3D building, traffic

02:28.160 --> 02:33.000
data overlay, indoor maps and minimum zoom level.

02:33.000 --> 02:39.760
Maximum zoom zoom level, all those things we can customize in the maps properties.

02:39.760 --> 02:46.240
So if you if you notice here we have this class map properties control and left click.

02:46.400 --> 02:56.280
We have those parameters we can set is building enabled indoor enabled location traffic longitude and

02:56.280 --> 02:59.920
latitude bounds map style options map type.

02:59.920 --> 03:07.080
Also we can get the map type inside the map type we have non normal satellite terrain hybrid.

03:07.120 --> 03:10.040
We're going to discuss those types later on.

03:10.040 --> 03:11.120
So don't worry.

03:11.160 --> 03:21.880
We're going to discuss the zoom the camera, the style longitude and latitude and so on okay UI settings

03:22.240 --> 03:32.440
um the controls user interactions settings on map loaded called when the map is fully loaded on map.

03:32.440 --> 03:36.560
A click called when the user taps anywhere on the map.

03:36.680 --> 03:43.120
On marker, click and on My Location button, click marker click or on map.

03:43.680 --> 03:52.360
Click all those handlers we're going to discuss and handle and lecture about them in the next couple

03:52.360 --> 03:53.320
of videos.

03:53.360 --> 04:01.960
On camera move, we can discuss the camera position state later on and uh, and customize it later on.

04:01.960 --> 04:09.760
Also, we have the content allows adding custom compose UI overlays, for example buttons, info windows,

04:09.760 --> 04:11.240
and others.

04:11.280 --> 04:15.760
Okay, let's start using the Google map here.

04:15.920 --> 04:20.560
Start with modifier fill maximum size.

04:20.560 --> 04:23.720
This is the modifier we can run our application now.

04:23.880 --> 04:32.320
Make sure you select the API and not signing report and click run and our app crashes.

04:32.360 --> 04:35.400
We open the Logcat.

04:35.440 --> 04:37.840
We missed the API key.

04:38.160 --> 04:42.760
So we have the fatal exception API key not found.

04:42.840 --> 04:50.080
Check that this code is added in the application element of the Android manifest.

04:50.120 --> 04:52.680
Copy this metadata.

04:52.720 --> 04:56.440
Go to manifest inside the application tag.

04:56.560 --> 04:59.520
Paste this meta data.

04:59.560 --> 05:01.560
Open the notepad.

05:01.680 --> 05:06.680
Copy the API key and replace it here.

05:06.720 --> 05:10.160
Okay, this is a very important step.

05:10.280 --> 05:18.080
This will link our application with Google Cloud and use the maps SDK.

05:18.200 --> 05:21.040
Run again and here we go.

05:21.080 --> 05:22.440
Congratulations.

05:22.800 --> 05:25.520
This is our Google map.

05:25.640 --> 05:36.000
In order to use it and without uh, without uh, any errors, use the permission internet run again.

05:36.000 --> 05:39.360
And this will prevent any errors.

05:39.400 --> 05:41.880
Okay, so congratulations guys.

05:42.160 --> 05:48.120
We created our very first Android application with the maps as the.
