WEBVTT

00:00.120 --> 00:01.120
Welcome back.

00:01.160 --> 00:04.920
We added the clustering library dependency.

00:05.200 --> 00:08.000
Now let's move to the main activity.

00:08.000 --> 00:12.560
And here let's move to the Google map scope.

00:12.600 --> 00:16.000
Let's start by marker clustering.

00:16.240 --> 00:18.840
Start with clustering.

00:19.040 --> 00:26.480
And here we have this composable function I want from you to focus with me.

00:26.480 --> 00:32.200
Select Clustering Ctrl and left click to open the declaration.

00:32.480 --> 00:36.440
And here we can notice that it's a public function.

00:36.440 --> 00:47.080
Clustering takes whatever any collection of that extends from cluster item and items collection T.

00:47.240 --> 00:55.800
This is very important because we're going to see what what uh what is the problem with this library

00:55.800 --> 00:59.160
and why we should pay attention to this declaration.

00:59.160 --> 01:05.580
And we have a lot of things we can, uh, declare on marker.

01:05.580 --> 01:07.020
Click on info window.

01:07.020 --> 01:08.980
Click on marker.

01:08.980 --> 01:10.260
Drag on info window.

01:10.860 --> 01:11.940
Click marker.

01:11.940 --> 01:15.100
Drag end and marker drag start okay.

01:15.300 --> 01:20.740
Also, we can see a lot of things inside this composable function.

01:20.740 --> 01:24.060
Also, we can notice that we have the cluster.

01:24.100 --> 01:29.860
Another version of the clustering items collection of T on cluster.

01:29.860 --> 01:32.140
Click we can handle on cluster.

01:32.140 --> 01:35.140
Click also on cluster item click.

01:35.180 --> 01:41.860
You can also define if the user clicks on the marker inside the cluster, or the user clicks on the

01:41.860 --> 01:43.180
cluster in general.

01:43.380 --> 01:53.940
Also, if the user clicks on the info window of the cluster item, also click Cluster Content, Cluster

01:53.940 --> 01:57.020
Item Content and on Cluster Manager.

01:57.020 --> 02:00.500
So we need this version of clustering.

02:00.500 --> 02:11.520
So back to here you can remove clustering and you can select here from those three cluster items from

02:11.560 --> 02:12.560
the clustering.

02:12.720 --> 02:21.200
So clustering you should specify some mandatory parameters like the items equals to.

02:21.640 --> 02:28.600
And here we need to specify the list of markers that we need to make a cluster.

02:28.640 --> 02:29.200
Okay.

02:29.520 --> 02:35.520
So I want from you to pay attention with me now because there is a very important note.

02:35.520 --> 02:37.480
You should pay attention to it.

02:37.520 --> 02:38.000
Okay.

02:38.160 --> 02:42.000
Let me create a list of markers.

02:42.000 --> 02:51.640
So here outside the Google map let me create the variables for the clustering example list of and here

02:51.800 --> 02:58.640
we need to for example make a marker list of markers and or.

02:58.680 --> 02:59.400
Let long.

02:59.440 --> 03:02.000
Let me start with lat long set.

03:02.040 --> 03:07.600
For example the first lat long at the equator zero zero.

03:07.800 --> 03:10.960
The second one is near it okay.

03:11.120 --> 03:16.380
So this this is the cluster items as of list of lat long.

03:16.420 --> 03:25.180
Now let's scroll down to clustering inside the Google Maps and let's specify the cluster items here.

03:25.340 --> 03:29.820
There is a very important note you should pay attention to it.

03:29.860 --> 03:34.700
Required cluster item but found lat long.

03:35.020 --> 03:42.300
If we create any type of lists it will give us this type of error.

03:42.460 --> 03:43.780
Type mismatch.

03:43.780 --> 03:44.500
Required.

03:44.500 --> 03:46.540
Cluster item found.

03:46.580 --> 03:47.860
Lat long.

03:48.100 --> 03:50.740
So let's go back to the cluster items.

03:50.740 --> 03:53.100
And here it's list of lat long.

03:53.140 --> 03:56.340
Let me try list of markers for example.

03:56.380 --> 03:56.860
Okay.

03:57.180 --> 04:00.860
Also we will get the same error.

04:01.140 --> 04:05.020
It's of type marker required cluster item.

04:05.340 --> 04:06.540
How to solve it.

04:06.580 --> 04:13.020
In the next video, we're going to create the cluster item that extends from cluster item.

04:13.020 --> 04:19.420
And we're going to create the custom items to be displayed for the clusters.
