Android Question How to modify existing polygons on Google Map?

GraemeW

Member
Licensed User
I've added about 20 polygons to a Google Map using GoogleMapsExtras and PolygonOptions.

Later, when the user checks a Checkbox I want to highlight one of the polygons with a yellow strokecolor. If the user then unchecks the Checkbox I want to change the strokecolor back to the original colour.

However, I can't find any way to get a specific polygon from the Google Map in order to modify it. There doesn't appear to be any ID or Tag property associated with the Polygon or PolygonOptions objects.

Anyone have any suggestions about how to solve this problem?

PS - I've used a map object to associate an ID with a polygonoptions object - but changing the strokecolor of the associated polygonoptions object doesn't affect the polygon on the Google Map..
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
B4X:
Dim poly As Polygon = mextra.AddPolygon(gmap,popt)
AddPolygon return the added Polygon object... You can later use this reference to change the polygon.

You should not use the used Polygonoptions. They are only needed to define before you use AddPolygon.

Afterwards you should use the Polygons Options/Methods to change something.
 
Last edited:
Upvote 0
Top