WEBVTT

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

00:01.160 --> 00:08.520
We created the list cluster items that contains 14 cluster items.

00:08.720 --> 00:12.200
Now let's create the manager.

00:12.240 --> 00:13.800
The cluster manager.

00:13.920 --> 00:20.840
This cluster manager handles clustering and rendering of marker.

00:20.840 --> 00:23.840
So let me create a new file.

00:23.840 --> 00:29.360
Or you can at the end of this file you can create the composable.

00:29.360 --> 00:38.560
But I prefer using a separate files name this remember cluster manager select file click okay.

00:38.920 --> 00:42.200
And let's start building our composable.

00:42.240 --> 00:48.200
This function returns a cluster manager of type cluster.

00:48.760 --> 00:57.680
This function creates and remembers a cluster manager instance that handles marker clustering logic

00:57.680 --> 00:59.520
for Google Maps.

00:59.520 --> 01:07.520
Returns a cluster manager, the core clustering manager for Google Maps utility library and the cluster

01:07.520 --> 01:08.400
item.

01:08.560 --> 01:13.920
This is generic type using your custom interface implementation.

01:13.920 --> 01:23.860
Let's start with the implementation context equals to local Context dot current.

01:24.140 --> 01:27.420
And this gets the Android context.

01:27.460 --> 01:34.220
Using composes local context needed because cluster manager requires a context.

01:34.260 --> 01:39.020
Then return because we need to return a cluster manager.

01:39.300 --> 01:46.460
Need to create a cluster manager instance using remember cluster manager.

01:46.620 --> 01:49.500
It's of type cluster item.

01:49.540 --> 01:54.340
Pass the context null and then apply alt plus.

01:54.340 --> 01:55.620
Enter to Reimport.

01:55.620 --> 01:56.460
Remember.

01:56.700 --> 02:02.820
And you can set the configuration or any additional cluster manager configuration.

02:02.860 --> 02:06.060
Okay now let's use this function.

02:06.060 --> 02:10.420
So inside my activity my main activity use.

02:10.460 --> 02:13.940
Remember cluster manager.

02:14.100 --> 02:19.700
And here we go alt plus enter to modify the Remember Cluster manager.

02:20.020 --> 02:26.700
And let me set it from IO dot master coding dot maps.

02:26.740 --> 02:27.260
Okay.

02:27.460 --> 02:35.220
So this function is remember cluster manager that handles clustering and rendering of Mark.
