Welcome back.
Similar to what we've done with dynamic Polylines, I'm going to create dynamic polygons.
So here create a new dynamic Polylines or polygons mutable state of lat long.
Then scroll down and instead of on map click I'll create dynamic polygons on map long click.
But don't worry, it's the same logic.
So here create a new dynamic polygon.
Dynamic polygon polygons equals to dynamic polygons plus the newly created lat long.
Okay, this is how we add markers to the newly created or the newly created marker to that dynamic polygon.
The third step, as we did before, is to create the polygon itself.
Scroll up and here representing the dynamic polygon.
But there is a very important notice here.
You should mention that this note is that the dynamic polygons should size should be greater than three
because in order to create any shape, you should have three points, which is the triangle for squared,
and so on.
Okay, so this is that dynamic polygons.
The size should be more than three dynamic polygons.
Color would be for example magenta and others which is a polygon okay.
Remove the color.
Set the content color fill color color dot magenta.
That's good.
Let me run and see the dynamic polygons on long.
Click on the map.
Long click on the map.
This is the first point.
Go to the Christmas island, the second point and the third point.
Here you can see that dynamic polygon is created.
Let's add the fourth, the fifth, the sixth.
And here we go guys.
This is our lovely created polygon.
This is how we create dynamic polygons and polylines.