This is code for searching latitude and longitude . so how to save into database.
function GetLocation() {
var geocoder = new google.maps.Geocoder();
var address = document.getElementById("txtAddress").value;
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();
var mapOptions = {
center: new google.maps.LatLng(latitude, longitude),
zoom: 18,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infoWindow = new google.maps.InfoWindow();
var latlngbounds = new google.maps.LatLngBounds();
var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
} else {
alert("Request failed.")
}
});
};
<textarea id="txtAddress" rows="1" cols="20"></textarea>
<input type="button" onclick="GetLocation()" value="Get Location" />
<div id="dvMap" style="width: 100%; height: 500px" align="center">
</div>