Find the Latitude and Longitude using Gmap
Hi,
Google gives the great Javascript Api for finding the Location latitude and longitude by just giving the address only
This is following code
<script src=”http://maps.google.com/maps?file=api&v=2&sensor=true&key=ABQIAAAANez3-95VQQxZUR1e1BaC7RQlRyH5qh-HDT3ImsMIYwyhpUeTghSwTS8yZGHT9D9mFG6mgXkotPdcKw” type=”text/javascript”></script>
var address =’chennai’;
var geocoder = new GClientGeocoder();
if ( geocoder ) {
geocoder.getLatLng(
address,
function(point) {
if ( !point ) {
//alert(address + ” not found”);
$(“#error”).html(address + ” not found”);
$(“#mapurl”).focus();
} else {
$(“#wp_geo_latitude”).val(point.lat());
$(“#wp_geo_longitude”).val(point.lng());
}
}
);
}
});
if you need more details please visit here
Advertisement























No trackbacks yet.