MarkersEventsOverlay Problem

dunski

Member
Licensed User
Longtime User
Can anyone help me with the folowing code which runs without any errors at all but will just not draw the icons on the map. The map loads but with no icons on the map. All values are being passed to the marker array correctly. Not even an error on the logs. it just shows all the correct values.
I think it is something about the way I am passing the the array of markers on these two lines:
B4X:
Markers.Initialize2(Array As Object(storeMarker(i-1)))
MarkersEventsOverlay1.AddMarkers(Markers)

B4X:
For i = 0 To Cursor1.RowCount - 1
        Cursor1.Position = i
      myMultiple = multipleDesc(Cursor1.GetString("MULTIPLE_ID"))
      LAT=Cursor1.GetString("LATITUDE")
      LON = Cursor1.GetString("LONGITUDE")
       storeMarker(i).Initialize(myMultiple,"DOUBLE CLICK TO AUDIT",LAT, LON, Icon)
    Next
    Cursor1.Close
   '   create a List and initialize it with the Markers
   Dim Markers As List
   Markers.Initialize2(Array As Object(storeMarker(i-1)))
   
   '   add the List of Markers to the MarkersEventsOverlay
   MarkersEventsOverlay1.AddMarkers(Markers)
 

dunski

Member
Licensed User
Longtime User
Solved

Just in case anyone was in terested I figured it out.

If you have a lot of icons to add to a map as in 1200 which I have loading to their coordinates on the mapview this is how you pass the markers to the MarkersEventsOverlay

B4X:
Dim Markers As List
   For i = 0 To Cursor1.RowCount - 1
   
        Cursor1.Position = i
      myMultiple = multipleDesc(Cursor1.GetString("MULTIPLE_ID"))
      LAT=Cursor1.GetString("LATITUDE")
      LON = Cursor1.GetString("LONGITUDE")
       storeMarker(i).Initialize(myMultiple,"DOUBLE CLICK TO AUDIT",LAT, LON, Icon)
      Markers.Initialize2(Array As Object(storeMarker(i)))

      MarkersEventsOverlay1.AddMarkers(Markers)
    Next
 
Upvote 0
Top