I'm currently loading a map with the following javascript.
google.load("maps", "2.x");
// Call this function when the page has been loaded
function initialize() {
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(52,-3), 13);
var point = new google.maps.LatLng(52,-3);
var marker = new google.maps.Marker(point, {draggable: true});
map.addOverlay(marker);
google.maps.Event.addListener(marker, "dragend", function(latlng) {
marker.openInfoWindowHtml("Dragged to <br>" + latlng);
});
}
google.setOnLoadCallback(initialize);
Later on, I want to add other markers to the map, after the user has input a (lat,lon) pair How can I access the map
variable that I created in the function initialize
?