Android Code Snippet [B4X] Check if Google Street View is available

Discussion in 'Code Snippets' started by Alexander Stolte, Feb 1, 2018.

  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    This code check's easy and fast if Google Street View is available.

    You need the latitude and longitude. You can here get a API Key. Here you can more read about this.

    Sub isStreetViewAvailable(lat As Float, lon As Float)
    Dim j As HttpJob
    "", Me)
    "" & lat & "," & lon & "&key=" & STREET_API)
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
    Dim jp As JSONParser
    Dim status As String = jp.NextObject.GetDefault("status"0)
    If  status.Contains("OK"Then
    Log("Streetview is available!")
    Log("Streetview is not available!")
    End If
    End If

    End Sub
    Have Fun with a new Feature!
    stanks, Erel and MarcoRome like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice