Hi,
Please refer below script to get latitude and longitude.
I referred below article
JavaScript
function GetLocation(Address) {
var geocoder = new google.maps.Geocoder();
var address = Address;
var location = [];
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
location.push(latitude);
location.push(longitude);
} else {
alert("Request failed.")
}
});
return location;
};
I hope this will help you out.