Sub search4locations2(addr As String)
Dim Key As String = "mykey"
Dim bounds As String ="40.868825,23.250299|41.438562,24.033075" 'limits
Dim postString As String
Dim su As StringUtils
Dim dir As HttpJob
dir.Initialize("",Me)
'postString="address=" & addr.Replace(" ","+").trim &"&bounds=" & bounds & "&key=" & Key
'Log("https://maps.googleapis.com/maps/api/geocode/json?"&postString)
dir.download2("https://maps.googleapis.com/maps/api/geocode/json",Array As String("address",addr,"bounds",bounds,"language","el","country","gr","key",Key))
Wait For (dir) JobDone(dir As HttpJob)
If dir.Success Then
Dim jp As JSONParser
jp.Initialize(dir.GetString)
Dim m As Map = jp.NextObject
Dim results As List = m.Get("results")
For Each colresults As Map In results
Dim formatted_address As String = colresults.Get("formatted_address")
Dim types As List = colresults.Get("types")
For Each coltypes As String In types
Next
Dim geometry As Map = colresults.Get("geometry")
Dim viewport As Map = geometry.Get("viewport")
Dim southwest As Map = viewport.Get("southwest")
Dim lng As Double = southwest.Get("lng")
Dim lat As Double = southwest.Get("lat")
Dim northeast As Map = viewport.Get("northeast")
Dim lng As Double = northeast.Get("lng")
Dim lat As Double = northeast.Get("lat")
Dim location As Map = geometry.Get("location")
Dim lng As Double = location.Get("lng")
Dim lat As Double = location.Get("lat")
Dim location_type As String = geometry.Get("location_type")
Dim address_components As List = colresults.Get("address_components")
For Each coladdress_components As Map In address_components
Dim types As List = coladdress_components.Get("types")
For Each coltypes As String In types
Next
Dim short_name As String = coladdress_components.Get("short_name")
Dim long_name As String = coladdress_components.Get("long_name")
Next
Dim place_id As String = colresults.Get("place_id")
Next
Dim status As String = m.Get("status")
End If
dir.Release
log(formatted_address)
End Sub