Android Question Streetview in Infowindow issue.

katrad

Member
Licensed User
Longtime User
Ok, what I have going on is I load a streetview picture on a webview control inside of a infowindow. I'm not sure where this is going bad. It was working now all I get is a blank infowindow (except for the label, which didnt change).

It used to work, but, since the new b4a version it stopped displaying. I attached a screen shot of what it used to be.

Here's the code that calls the streetview
B4X:
Sub Maps_MarkerClick (Marker1 As Marker) As Boolean 'Return True to consume the click
    Dim Latt As Double = Marker1.Position.Latitude
    Dim Lng As Double = Marker1.Position.Longitude
    Dim StaticSV_APIKey As String = "AI**********************************79k"
    Dim MyAdr As String = ""
    ' Check if Pics are Needed
    If Main.ShowPics = False Then WV.Visible = False Else WV.Visible = True
    If Main.ShowPics = False Then Return False
    '
    li18.Visible = True
    li18.BringToFront
    '
    Dim JO As JavaObject = WV
    JO.Runmethod("clearCache", Array As Object(True))
    '
    Log(MyAdr)
    Log("Maps_MarkerClick")
    WebAdr = "https://maps.googleapis.com/maps/api/streetview?size=100x100&location="&Latt&","&Lng&"&fov=120&key="&StaticSV_APIKey     
    WV.LoadUrl(WebAdr)
    Log(WebAdr)
    '   
    Misc_Func.Wait(3) ' wait 3 secs for the picture to load.
    Return False
End Sub

Any help would be appreciated.
 

Attachments

  • Map_2.png
    Map_2.png
    119 KB · Views: 148

katrad

Member
Licensed User
Longtime User
I'm adding a wait because it takes a few seconds for Google's servers to return the picture. I only wait 3 seconds because I dont want the user to be hung up waiting for the picture to arrive.

It was a function I copied from example on this site:
B4X:
Sub Wait(Sekunden As Int)  
Dim Ti As Long  
Ti = DateTime.Now + (Sekunden * 1000)  
Do While DateTime.Now < Ti     
   DoEvents  
Loop
End Sub
 
Upvote 0

katrad

Member
Licensed User
Longtime User
OK, I'll change that and post back my results. It will be tomorrow, I'm just stopping for the day.

I appreciate you guys so much, thank you for your help!!!
 
Upvote 0
Top