Dim API_KEY As String = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
Dim res As String
Dim GetAddressJob As HttpJob
GetAddressJob.Initialize("GetAddress", Me)
GetAddressJob.Download2("https://maps.googleapis.com/maps/api/geocode/json", Array As String("latlng", lat & "," & lon,"key",API_KEY))
Wait For (GetAddressJob) JobDone(GetAddressJob As HttpJob)
If GetAddressJob.Success Then
Dim jp As JSONParser
jp.Initialize(GetAddressJob.GetString)
Dim m As Map = jp.NextObject
If m.Get("status") = "OK" Then
Dim results As List = m.Get("results")
If results.Size > 0 Then
Dim first As Map = results.Get(0)
res = first.Get("formatted_address")
Log(res)
Module1.LokasiFLP=res
'res contain address string
End If
End If
End If
GetAddressJob.Release