将地址转换为lat long之后,我想用更新的值进行ajax调用,但我无法理解。
var start = document.getElementById("src").value;
mygc.geocode({'address': start}, function(results, status){
var startupdate = results[0].geometry.location.lat()+","+results[0].geometry.location.lng();
});
end = document.getElementById("dst").value;
mygc.geocode({'address': end}, function(results, status){
var endupdate = results[0].geometry.location.lat()+","+results[0].geometry.location.lng();
})
$.ajax({
type: 'GET',
url: "http://example.com/src="+startupdate+"&dst="+endupdate,