Hi All,
While searching for ways to parse lat/lon, I came across this website, but googling for the site itself
I read it is not safe.. but it used by many people..
The site name is: googleapis.com
Thanks in advance
While searching for ways to parse lat/lon, I came across this website, but googling for the site itself
I read it is not safe.. but it used by many people..
The site name is: googleapis.com
Thanks in advance
B4X:
// Example of using the code to parse Latitude and Longitude from a Google Geocoding call.
//
Dim address As String
address = "98052"
Dim URL As String
URL = "http://maps.googleapis.com/maps/api/geocode/json?address=" & address & "&sensor=false"
'Create Http object
Dim http As Object
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
'Send request To URL
http.Open "GET", URL
http.send
'Get response data As a string
response = http.responseText
' Tokenize the response '
Dim tokens As Object
Dim tokenized As String
tokenized = tokenizer.JsonTokenize(response, tokens)
' Search for latitude and longitude '
Dim dictA As Object
Set dictA = tokenizer.JsonDictionary(tokenized, tokens)
Dim listB As Object
Set listB = tokenizer.JsonList(dictA.Item("results"), tokens)
Dim dictC As Object
Set dictC = tokenizer.JsonDictionary(listB.Item("0"), tokens)
Dim dictD As Object
Set dictD = tokenizer.JsonDictionary(dictC.Item("geometry"), tokens)
Dim dictE As Object
Set dictE = tokenizer.JsonDictionary(dictD.Item("location"), tokens)
Dim lat As Double
lat = tokenizer.JsonDouble(dictE.Item("lat"), tokens)
Dim lng As Double
lng = tokenizer.JsonDouble(dictE.Item("lng"), tokens)