Android Question Dynamic content in InfoWindowAdapter - how to?

ThePuiu

Active Member
Licensed User
Longtime User
I want that when the user clicks on an existing marker, download some information from the server and display it in InfoWindowAdapter. I don't know how to fill in InfoWindowAdapter with the data returned from the server...
I use the code:
B4X:
Sub MapFragment1_Ready
    gmap = MapFragment1.GetMap
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
        gmap.MyLocationEnabled = True
    Else
        Log("No permission!")
        Return
    End If
    
    Dim extra As GoogleMapsExtras
    Dim iwa As InfoWindowAdapter
    iwa.Initialize("iwa")
    extra.SetInfoWindowAdapter(MapFragment1.GetMap,iwa)
      
    MapPanel.Initialize("")
    Activity.AddView(MapPanel, 0, 0, 300dip, 300dip)
    MapPanel.LoadLayout("itemMarkerHarta")

    MapPanel.RemoveView
End Sub
......
Sub iwa_GetInfoContents(Marker1 As Marker) As View
    GetInfoMarker(Marker1.Snippet)  
    
    LabelInfo1.Text = ?????

    Return MapPanel
End Sub
......
Sub GetInfoMarker(aidiMarker As String)
    Dim jobDownload As HttpJob
    jobDownload.Initialize("jobLoadInfo", Me)
    ProgressDialogShow2("Operatie in progres...", False)
    
    ................................. reading data from server .....................................................

    ProgressDialogHide
    jobDownload.Release()

End Sub
 

ThePuiu

Active Member
Licensed User
Longtime User
in which event should I call the download function for the selected marker?
iwa_GetInfoContents(Marker1 As Marker) As View it is called only in Release mode and I cannot understand the flow of the application...
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
I understand that the data must be available before the InfoWindowAdapter is displayed, but in my case there is a large number of markers and the information to be displayed for each of them changes from minute to minute ...
 
Upvote 0
Top