how i can get latitude from a city name like Florida how i can get the latitude and longitude from sending a json to google map api.
any way to do this.
i need a sollution in javascript or jquery through the json.
how i can get latitude from a city name like Florida how i can get the latitude and longitude from sending a json to google map api.
any way to do this.
i need a sollution in javascript or jquery through the json.
Not sure what you mean when you say send json but you can do it with this function:
function getLatLong(address){
var geo = new google.maps.Geocoder;
geo.geocode({'address':address},function(results, status){
if (status == google.maps.GeocoderStatus.OK) {
return results[0].geometry.location;
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
that will return an object which you can reference with .lat() and .lng() to get the latitude and longitude.
hello thomas thanks for help me but i need a thing more
when i run the code he tell me (27.19, 78.01) but i need a position too like EAST , WEST
how i can get them in format (27.19, 78.01E) instead for (27.19, 78.01).
E for EAST