开发者

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.");
  });
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜