Android Question Remove Multiple Circles from Google Maps

rscheel

Well-Known Member
Licensed User
Longtime User
Hello, I need to add multiple circles in google maps and in the same way to be able to remove them all, so far I can add them, but I can't delete them, they keep drawing on themselves

Add Circles:
Dim Circle1 As Circle
Circle1 = gmapExtra.AddCircle(gmap, co)

Remove circles:
Circle1.Remove

thanks for your help.
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
save the circles to a list and then you have the references to delete them.

for example.

B4X:
'Global definition
Dim MyCircles as list

'initialisation
MyCircles.initialize

'... Your code...
Dim Circle1 As Circle
Circle1 = gmapExtra.AddCircle(gmap, co)
MyCircles.add(Curcle1)


' Later...
private sub Removeallcircles
for each c as circle in MyCircles
    c.remove
next
end sub
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
save the circles to a list and then you have the references to delete them.

for example.

B4X:
'Global definition
Dim MyCircles as list

'initialisation
MyCircles.initialize

'... Your code...
Dim Circle1 As Circle
Circle1 = gmapExtra.AddCircle(gmap, co)
MyCircles.add(Curcle1)


' Later...
private sub Removeallcircles
for each c as circle in MyCircles
    c.remove
next
end sub

Thank you very much, it is just what I needed, thank you
 
Upvote 0
Top