WEBVTT

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

00:01.160 --> 00:04.560
We learned about the single map click.

00:04.880 --> 00:10.600
Now let's learn about another gesture which is on map long click.

00:10.720 --> 00:19.000
If you go to the Google map declaration we have on map, click on map long click on map, loaded my

00:19.000 --> 00:26.200
location and others on click and other clicks on my location.

00:26.200 --> 00:26.720
Click.

00:26.720 --> 00:34.280
But I'm going to show you the most used things and gestures on map.

00:34.320 --> 00:37.200
Long click equals to.

00:37.360 --> 00:42.960
We need to specify a lambda expression and here we can get the lat long.

00:42.960 --> 00:47.600
For example you could you longer click this location.

00:47.600 --> 00:55.200
Let me run and notice inside the logcat the position where I logged clicked.

00:55.240 --> 01:02.480
If I long click here you notice you long click lat long this position.

01:02.480 --> 01:13.560
So if I click here on Australia long click and I get the lat long okay let me place another marker.

01:13.560 --> 01:18.120
But in this case it's colored uh blue.

01:18.280 --> 01:21.200
So similar to what we've done before.

01:21.480 --> 01:34.710
Val long click markers equals to remember mutable state of lat long and scroll down here ad long clicked

01:34.710 --> 01:41.470
markers dot add lat long and the scope of Google Map display.

01:41.470 --> 01:44.190
The long clicked markers.

01:44.190 --> 01:47.270
Long clicked markers dot for each.

01:47.510 --> 01:52.350
Set the location and marker long marker at location.

01:52.350 --> 01:54.870
Customize the icon.

01:54.910 --> 01:59.470
Set the bitmap descriptor factory dot default marker.

01:59.630 --> 02:03.030
And here I need to color it with blue.

02:03.030 --> 02:08.150
For example descriptor factory you blue okay, now let's run.

02:08.150 --> 02:15.830
Let's test here in Singapore I'm gonna long press the map and here we go.

02:15.870 --> 02:20.310
This is our marker long marker at lat long.

02:20.710 --> 02:21.590
This is the lat.

02:21.590 --> 02:24.070
And this is the long of the marker.

02:24.070 --> 02:25.230
Another marker.

02:25.230 --> 02:30.990
Another marker I will uh those are for the long click.

02:30.990 --> 02:34.230
Now let's start with the single click.

02:34.270 --> 02:35.390
Single click.

02:35.430 --> 02:46.190
You can see the red markers are single clicked, the blue markers are long click and so on okay so congratulations

02:46.190 --> 02:46.670
guys.

02:46.670 --> 02:50.870
We handled the long click gesture on the map.
