Android Question Add the List of Markers to the MarkersOverlay

T201016

Active Member
Licensed User
Longtime User
Hi.
How can I modify the code line to add all markers? The following example allows me ONLY to initialize the LAST marker to MarkersOverlay.

Thank you in advance for your ideas.

B4X:
'    create a List and initialize it with the 2 Markers
        Dim Markers As List
        Dim Marker1 As Marker
      
      

        For i = 0 To eLoadImages.Size -1
            ChosenName = eLoadImages.Get(i)
            OverlayMapPhoto.exif.Initialize(eFilePath, ChosenName)

            Dim Lt,Lg As String
            Lt = TM.MeGeo(OverlayMapPhoto.exif.getAttribute(OverlayMapPhoto.exif.TAG_GPS_LATITUDE),0)
            Lg = TM.MeGeo(OverlayMapPhoto.exif.getAttribute(OverlayMapPhoto.exif.TAG_GPS_LONGITUDE),0)
          
            If Lt.Length > 0 And Lg.Length > 0 Then
                Marker1.Initialize(i, ChosenName, Lt, Lg, ic_touch)
                Markers.Initialize2(Array As Object(Marker1))
            End If
        Next
        '    add the List of Markers to the MarkersOverlay
        MarkersOverlay1.AddMarkers(Markers)
        Markers.Clear
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Why are you initializating the Markers list in every step of the loop For-Next ? Add marker1 to Marker list but not initializate Marker list in every step of the loop.
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
Why are you initializating the Markers list in every step of the loop For-Next ? Add marker1 to Marker list but not initializate Marker list in every step of the loop.

MarkersOverlay1.AddMarkers (Markers) does not want to function without initialization.
 
Upvote 0
Top