I have a map that I generated initial four markers. Markers creates a polygon. The user can move the markers on the map. At Marker_DragEnd polygon must be drawn in the new position. I did like this:
But on map appear several polygons overlapping. What should I do to make refres map?
B4X:
Sub OnMarkerDragListener1_DragEnd(Marker1 As Marker)
Dim M As LatLng
M.Initialize(Marker1.Position.Latitude, Marker1.Position.Longitude)
MARKERI.Set(Marker1.Title, M)
Dim PolygonOptions1 As PolygonOptions
Dim GoogleMapsExtras1 As GoogleMapsExtras
PolygonOptions1.Initialize
PolygonOptions1.FillColor=Colors.ARGB(128, 255, 0, 0)
PolygonOptions1.AddPoints(MARKERI)
PolygonOptions1.StrokeColor=Colors.Black
PolygonOptions1.StrokeWidth=2
Polygon1=GoogleMapsExtras1.AddPolygon(mFragment.GetMap, PolygonOptions1)
End Sub