Here's a demo of how to use the nominatim geocoding API for free.
Note:
There are other geocoding options if you want to know, leave your comments.
Demo file attached
Enter address get location
Enter location get address
Note:
There are other geocoding options if you want to know, leave your comments.
Demo file attached
B4X:
Sub GeoCoderNominatim(Query As String) As ResumableSub
Dim ResultURL As String
Dim j As HttpJob
Dim Parameter() As String = Array As String ("q", Query, "format", "json", "limit", "1", "addressdetails", "1")
Try
j.Initialize("", Me)
j.Download2("https://nominatim.openstreetmap.org/search", Parameter)
j.GetRequest.SetHeader("Content-Type","application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
ResultURL = j.GetString
Else
Log(j.ErrorMessage)
End If
Catch
Log(LastException)
End Try
j.Release
Return ResultURL
End Sub
Enter address get location
Enter location get address