How to draw polygon on Google maps?

I need to create an application that allows the user to create a polygon directly in the maps component.

I didn’t find any function that does this and no tutorial.

Who can help me the solution can be both for Google Maps, When for MapBox, whichever is easier.

Sorry for the mistakes in the sentences. I’m using google translate. I hope you can understand my need.

I haven’t tried this but from the Anvil Docs this is possible

Searching the forum I found this post.

I think you need to capture the points of the polygon in LatLng objects and then use those to display the polygon.

Have you got a clone of the app to show what you have done so far?

1 Like

Hello!!
I resumed the project and managed to move forward. I was able to use the mouse to draw the map directly in Google Maps and also retrieve the drawing in a GoogleMap.Polygon object.

In order to finish my project, I need to put a label on the drawn map so that it can be identified by the user, when there are many polygons together.

In the same way as the image below.

Thanks a lot for the help. As soon as I finish the first version of the application I will share it with you.

1 Like