Hi all !
Is it possible to get GPS coordinates by address ?
<script type="text/javascript">
var dir1 = "5th ave, new york";
var google_url = "http://maps.googleapis.com/maps/api/geocode/json?address=";
var sensor = "&sensor=false";
var resultado;
function myFunction(){
$.getJSON(
google_url+dir1+sensor,
function(result){
$( "body" ).append( "Latitude: " + JSON.stringify(result.results[0].geometry.bounds.northeast.lat) )
$( "body" ).append( "Longitude: " + JSON.stringify(result.results[0].geometry.bounds.northeast.lng) )
});
}
#include "FiveWin.ch"
function Main()
local cGoogleURL := "http://maps.googleapis.com/maps/api/geocode/json?address="
local cAddress := "5th ave, new york"
local cSensor := "&sensor=false"
local cKey := "&key=" + MY_API_KEY
MsgInfo( WebPageContents( cGoogleURL + cAddress + cSensor + cKey ) )
return nil
#include <fivewin.ch>
function Main()
local cGoogleURL := "https://nominatim.openstreetmap.org/search?format=json&q="
local cAddress := "5th ave, new york"
local aReturn, i, cTxt := ""
aReturn := hb_jsonDecode( WebPageContents( cGoogleURL + cAddress) )
if !empty(aReturn)
for i:=1 to len(aReturn)
cTxt += aReturn[i,"display_name"] + e"\r\n"
cTxt += aReturn[i,"lat"]+" "+aReturn[i,"lon"] + e"\r\n" + e"\r\n"
next
else
cTxt:="not found"
endif
MsgInfo(cTxt)
return nil
#include "FiveWin.ch"
function Main()
local cGoogleURL := "https://nominatim.openstreetmap.org/search?format=json&q="
local cAddress := "5th ave, new york"
local aReturn, i, cTxt := ""
// aReturn := hb_jsonDecode( WebPageContents( cGoogleURL + cAddress) ) // *** Change this ***
aReturn := WebPageContents( cGoogleURL + cAddress)
hb_jsondecode( aReturn, @aReturn )
if !empty(aReturn)
for i:=1 to len(aReturn)
cTxt += aReturn[i,"display_name"] + e"\r\n"
cTxt += aReturn[i,"lat"]+" "+aReturn[i,"lon"] + e"\r\n" + e"\r\n"
next
else
cTxt:="not found"
endif
MsgInfo(cTxt)
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], nageswaragunupudi and 41 guests