I am trying create a map using google maps v3 api. I have found the below code over internet and I want to show the latitude and logitude in map window instead of address.
Looks like you might be looking for just regular geolocation stuff? Here's my snippett from a project to grab a user's lat/long
trigger show_user_location(); to begin the geolocation API.
function show_user_location(){
navigator.geolocation.getCurrentPosition(display_user_location, error_response);
}
function display_user_location(user_position){
var lat = user_position.coords.latitude;
var lon = user_position.coords.longitude;
// once we get here make that AJAX query
// #loc.value="Your latitude is: "+lat+", your longitude is: "+lon+"
"+ "";
// I often put the lat/lon in a hidden form for later retrieval here.
// value = document.getElementById('lat').value;
// value = document.getElementById('lat').value;
document.getElementById("lat").value = lat;
document.getElementById("long").value = lon;
}