Sunday, 25 August 2013

Callback on loading basic Google Maps with marker to display coordinates

Callback on loading basic Google Maps with marker to display coordinates

I've got a simple map, on Google Maps, with a marker.
I would like to display the coordinates, that are dynamically set, in a
div above the map.
Is there any callback functionality that I can tap in to here?
function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
google.maps.event.addDomListener(window, 'load', initialize);

No comments:

Post a Comment