In this video we're going to learn about Polylines.
A polyline is a series of connected line segments used to mark paths or routes on Google Map.
It's useful for displaying routes, boundaries, or any continuous line based data.
Let's start by drawing a simple polyline between two or more points.
You can create markers or you can create lists of lat long points.
Okay, so let me start by Polylines Val Kuala Lumpur.
This is the lat long of Kuala Lumpur.
This is the Bangkok coordinates and create val.
The route points equals to list of Singapore, Kuala Lumpur and Bangkok.
Okay.
I need to connect the three lat long variables Bangkok, Kuala Lumpur and the Singapore variable.
Okay.
Now scroll down.
Let me add the polyline to Google Map.
We are inside the Google map scope.
So inside this Create a new polyline.
Set the points to routes points.
Okay, this is the route points and setting the points attribute to them.
You can explore the polyline, so open it.
In the next video we're going to learn how to customize it.
But at first run and you can notice that we have a line displayed between Bangkok, between Singapore
and between Kuala Lumpur.
Okay.
This is the polyline that we drew here.
Now let's explore the polyline.
Composable.
We have the points attribute.
It takes a list of latlong clickable.
You can make it as a clickable or not color.
You can customize the color and cap geodesic join type pattern start cap tag visible with z index and
on click.
Let me customize the color attribute.
Make it red.
Set the width to five line width in pixels.
Five.
F.
Here we go.
This is our polyline.
You can notice it's in red.
Now its width is five.
Also we can customize the clickability.
So make the clickable true.
We can allow the user to click on it.
Also we can customize the onclick.
For example display a log that you clicked the polyline.
Let me run.
Notice that tag.
The tag message go to look at scroll down.
If I click on the polyline let me search for tag.
You click polyline.
Okay.
So here we customized the polyline and add the Clickability to it.
Okay.
You can add the other parameters like geodesic follows Earth's curvature.
Let me show you geodesic true.
Run again.
It will follow the Earth's curvature.
Great for long distances.
Okay.
This is how we customize the polyline.