Javascript example
HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3"></script>
<div id="map" style="margin-left:50px;margin-top:50px"></div>
<div id="footer" style="margin-left:100px; padding:10px;"></div>
CSS
body {font:12px arial; margin:0px}
#map {
height:400px;
width:400px;
padding-left:100px;
}
JavaScript
var map;
coord = new google.maps.LatLng(38.939201, -94.747640)
function initialize() {
var mapOptions = {
zoom: 16,
center: coord
};
map = new google.maps.Map(document.getElementById('map'), mapOptions);
var coordInfoWindow = new google.maps.InfoWindow();
coordInfoWindow.setContent('38.939201, -94.747640');
coordInfoWindow.setPosition(coord);
coordInfoWindow.open(map);
google.maps.event.addListener(map, "mousemove", function (event) { ev = event; document.getElementById("footer").innerHTML = "Mouse X Y:" + ev.pixel.toString() + " - Lat Lng:" + ev.latLng.toString() });
google.maps.event.trigger(map, "resize");
}
google.maps.event.addDomListener(window, 'load', initialize);