Hello, is it possible to provide a name to each created polygon (such as "area 1", "area 2" ...) and save it in a SQLite table to be able to redraw them if the program is closed?
No. YOU build the Polygon; you know what values you are using. It is you who need this functionality so it is you who need to write the code.
Store all informations you need to rebuild the Polygon in a Map or a List or a Customtype or a combination and store it in a Database. Write a method to read them back from Database and rebuild the Polygon based on the information stored.
Thanks for the answers. My main problem was how to assign a name to the polygon so I could later reference it, without having to select it by clicking on it.
B4X:
Sub Process_Globals
….
Private MiPoligono(20) As MapPolygon
…..
MyPoligon (1) = GMap.AddPolygon (lstPointsLatLng, LineWidthPolygon, LineColorPolygon, FillColorPolygon, OpacityPolygon)
There is no property that allows me to assign a name to the created polygon, such as "area1" .... "area20", in the style of MyPoligono (1) .tag
As @DonManfred stated, it is all up to you how you wish to store the name, points and other details of your poly (map, list or sql table) - select and display it.
There are many examples on this forum for you to reference on this subject matter. Easy stuff - research and experiment, like we all do to arrive at a solution.
The best solution is YOUR solution.
As @DonManfred stated, it is all up to you how you wish to store the name, points and other details of your poly (map, list or sql table) - select and display it.
There are many examples on this forum for you to reference on this subject matter. Easy stuff - research and experiment, like we all do to arrive at a solution.
The best solution is YOUR solution.