Rails 3 gmaps4rails (clicking on the map)
Im trying to do a click on map that shows some info. Im using google API's
Gmaps4Rails.callback = function() {
google.maps.event.addListener(map, "click", function开发者_运维百科() {
alert("You clicked the map.");
});
};
but this is not working, It doesnt no anything
You're simply not getting the map object properly: it's stored in the Gmaps4Rails namespace:
Gmaps4Rails.callback = function() {
google.maps.event.addListener(Gmaps4Rails.map, "click", function() {
alert("You clicked the map.");
});
};
精彩评论