Android Question Show google map market title

fanfalveto

Active Member
Licensed User
How can I add all the titles to each of the markers.
Any ideas ?, thanks
I tried Dim marker2 () as Marker and inside the for marker2 (i) but without success.

B4X:
Dim marker2 As Marker
........................................
Sub JobDone(job As HttpJob)
    If job.Success Then
        res = job.GetString
        Log("Response from server: " & res)
        parser.Initialize(res)
        Select job.JobName
            Case chicas
                todas = parser.NextArray 'returns a list with maps
                For i = 0 To todas.Size - 1
                    numero=todas.Size-1
                    m = todas.Get(i)
                    Dim latitud As Float
                    latitud =m.Get("latitud")
                    Dim longitud As Float
                    longitud=m.Get("longitud")
                    Dim nombre As String
                    nombre=m.Get("nombre")
                    marker2=GoogleMap1.AddMarker(latitud,longitud, nombre)
                    marker2.InfoWindowShown=True
                Next           
        End Select
    Else
        Log(job.ErrorMessage)
        ToastMessageShow("Error: " & job.ErrorMessage, True)
    End If
    job.Release

End Sub
 

HAH

Active Member
Licensed User
Try to move Dim Marker2 as Marker inside the loop, Just above marker2=GoogleMap1.AddMarker(latitud,longitud, nombre)
 

fanfalveto

Active Member
Licensed User
Thank you for the answer, but when debug, I see that the titles are assigned to each one of them but only the last one is visible. = - (
 

Erel

Administrator
Staff member
Licensed User
1. You shouldn't have a JobDone sub.
[B4X] OkHttpUtils2 with Wait For

2. Better to assign the value immediately:
B4X:
Dim nombre As String = m.Get("nombre")
3. Only a single marker can show its info window. The other visible infos will be hidden.
 
Top