Вы можете использовать это поочередно:
URL : http://maps.googleapis.com/maps/api/geocode/json?address=santa+cruz&components=postal_code:695564&sensor=false
Просто назовите этот URL в jquery-ajax, и в результате вы получите длинный лат.
Пример использования jquery-ajax :
$(document).ready(function(){
var zipcode = 695564;
$.ajax({
url : "http://maps.googleapis.com/maps/api/geocode/json?address=santa+cruz&components=postal_code:"+zipcode+"&sensor=false",
method: "POST",
success:function(data){
latitude = data.results[0].geometry.location.lat;
longitude= data.results[0].geometry.location.lng;
alert("Lat = "+latitude+"- Long = "+longitude);
}
});
});
Пример результата JSON из API Google:
{
"results" : [
{
"address_components" : [
{
"long_name" : "695564",
"short_name" : "695564",
"types" : [ "postal_code" ]
},
{
"long_name" : "Thiruvananthapuram",
"short_name" : "TVM",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Kerala",
"short_name" : "KL",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "India",
"short_name" : "IN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Kerala 695564, India",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 8.5894172,
"lng" : 77.0210912
},
"southwest" : {
"lat" : 8.5616185,
"lng" : 76.96664299999999
}
},
"location" : {
"lat" : 8.5753702,
"lng" : 76.99310740000001
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 8.5894172,
"lng" : 77.0210912
},
"southwest" : {
"lat" : 8.5616185,
"lng" : 76.96664299999999
}
}
},
"partial_match" : true,
"types" : [ "postal_code" ]
}
],
"status" : "OK"
}
Приветствие ..