Welcome back.
We learned about the single map click.
Now let's learn about another gesture which is on map long click.
If you go to the Google map declaration we have on map, click on map long click on map, loaded my
location and others on click and other clicks on my location.
Click.
But I'm going to show you the most used things and gestures on map.
Long click equals to.
We need to specify a lambda expression and here we can get the lat long.
For example you could you longer click this location.
Let me run and notice inside the logcat the position where I logged clicked.
If I long click here you notice you long click lat long this position.
So if I click here on Australia long click and I get the lat long okay let me place another marker.
But in this case it's colored uh blue.
So similar to what we've done before.
Val long click markers equals to remember mutable state of lat long and scroll down here ad long clicked
markers dot add lat long and the scope of Google Map display.
The long clicked markers.
Long clicked markers dot for each.
Set the location and marker long marker at location.
Customize the icon.
Set the bitmap descriptor factory dot default marker.
And here I need to color it with blue.
For example descriptor factory you blue okay, now let's run.
Let's test here in Singapore I'm gonna long press the map and here we go.
This is our marker long marker at lat long.
This is the lat.
And this is the long of the marker.
Another marker.
Another marker I will uh those are for the long click.
Now let's start with the single click.
Single click.
You can see the red markers are single clicked, the blue markers are long click and so on okay so congratulations
guys.
We handled the long click gesture on the map.