How can I get the google maps object from my DIV?
This is what I did to set the map:
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
Then I want to get the map to do this:
var marker = new google.maps.Marker({
position: initialLocation,
map: document.getElementById("map_canvas"),
title:"AJAX!"
});
Of course this produces an error.
Uncaught Error: Invalid value for property : [object HTMLDivElement]
I guess if it expects a map object then you need to keep track of that map object so you can use it in other functions. Something like: