Ruby on rails 在Google Maps for Rails中输入pin码

Ruby on rails 在Google Maps for Rails中输入pin码,ruby-on-rails,ruby-on-rails-3,google-maps,google-maps-api-3,gmaps4rails,Ruby On Rails,Ruby On Rails 3,Google Maps,Google Maps Api 3,Gmaps4rails,我目前正在使用它来显示一些由数据库中的地理编码数据生成的标记,这非常有效:)现在我想添加一些功能,允许用户在地图上放置一个pin(标记),并最终将这些坐标记录到数据库中(我想是通过restful调用)。但现在我正在尝试理解是否/如何将google.maps.event.addListener配置为buildMap。我当前的buildMap到pretty box标准: handler = Gmaps.build('Google'); handler.buildMap({ provider:

我目前正在使用它来显示一些由数据库中的地理编码数据生成的标记,这非常有效:)现在我想添加一些功能,允许用户在地图上放置一个pin(标记),并最终将这些坐标记录到数据库中(我想是通过restful调用)。但现在我正在尝试理解是否/如何将google.maps.event.addListener配置为buildMap。我当前的buildMap到pretty box标准:

handler = Gmaps.build('Google');
    handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
      markers = handler.addMarkers(<%=raw @hash.to_json %>);
      handler.map.centerOn({ lat: 51.5008, lng: 0.1247 }) //center on Big ben
      handler.bounds.extendWith(markers);
      handler.fitMapToBounds();
    });
handler=Gmaps.build('Google');
buildMap({provider:{},internal:{id:'map'}},function(){
markers=handler.addMarkers();
handler.map.centerOn({lat:51.5008,lng:0.1247})//大本钟中心
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
});

任何帮助都需要大量参与:)

在回调中添加侦听器:

handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
  markers = handler.addMarkers(<%=raw @hash.to_json %>);
  handler.map.centerOn({ lat: 51.5008, lng: 0.1247 }) //center on Big ben
  handler.bounds.extendWith(markers);
  handler.fitMapToBounds();

  google.maps.event.addListener(handler.getMap(), 'click', yourFunction)
});
handler=Gmaps.build('Google');
buildMap({provider:{},internal:{id:'map'}},function(){
markers=handler.addMarkers();
handler.map.centerOn({lat:51.5008,lng:0.1247})//大本钟中心
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
google.maps.event.addListener(handler.getMap(),'click',yourFunction)
});

在回调中添加侦听器:

handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
  markers = handler.addMarkers(<%=raw @hash.to_json %>);
  handler.map.centerOn({ lat: 51.5008, lng: 0.1247 }) //center on Big ben
  handler.bounds.extendWith(markers);
  handler.fitMapToBounds();

  google.maps.event.addListener(handler.getMap(), 'click', yourFunction)
});
handler=Gmaps.build('Google');
buildMap({provider:{},internal:{id:'map'}},function(){
markers=handler.addMarkers();
handler.map.centerOn({lat:51.5008,lng:0.1247})//大本钟中心
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
google.maps.event.addListener(handler.getMap(),'click',yourFunction)
});

在回调中添加侦听器:

handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
  markers = handler.addMarkers(<%=raw @hash.to_json %>);
  handler.map.centerOn({ lat: 51.5008, lng: 0.1247 }) //center on Big ben
  handler.bounds.extendWith(markers);
  handler.fitMapToBounds();

  google.maps.event.addListener(handler.getMap(), 'click', yourFunction)
});
handler=Gmaps.build('Google');
buildMap({provider:{},internal:{id:'map'}},function(){
markers=handler.addMarkers();
handler.map.centerOn({lat:51.5008,lng:0.1247})//大本钟中心
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
google.maps.event.addListener(handler.getMap(),'click',yourFunction)
});

在回调中添加侦听器:

handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
  markers = handler.addMarkers(<%=raw @hash.to_json %>);
  handler.map.centerOn({ lat: 51.5008, lng: 0.1247 }) //center on Big ben
  handler.bounds.extendWith(markers);
  handler.fitMapToBounds();

  google.maps.event.addListener(handler.getMap(), 'click', yourFunction)
});
handler=Gmaps.build('Google');
buildMap({provider:{},internal:{id:'map'}},function(){
markers=handler.addMarkers();
handler.map.centerOn({lat:51.5008,lng:0.1247})//大本钟中心
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
google.maps.event.addListener(handler.getMap(),'click',yourFunction)
});

显示已解释的代码。也许显示你的解释代码。也许显示你的解释代码。也许显示你的解释代码。也许是表示歉意,我有点忙得忘了投票。非常感谢您的快速响应——当然,首先发布了gmaps4rails项目——非常感谢:)它让我的东西用javascript工作了——虽然我转换成了coffeescript,但由于某种原因无法工作——但这是另一个问题:)抱歉,我有点忙于工作,忘了投票。非常感谢您的快速响应——当然,首先发布了gmaps4rails项目——非常感谢:)它让我的东西用javascript工作了——虽然我转换成了coffeescript,但由于某种原因无法工作——但这是另一个问题:)抱歉,我有点忙于工作,忘了投票。非常感谢您的快速响应——当然,首先发布了gmaps4rails项目——非常感谢:)它让我的东西用javascript工作了——虽然我转换成了coffeescript,但由于某种原因无法工作——但这是另一个问题:)抱歉,我有点忙于工作,忘了投票。非常感谢您的快速响应——当然,首先发布了gmaps4rails项目——非常感谢:)它让我的东西在javascript中工作——尽管我转换成了coffeescript,但由于某种原因它不起作用——但这是另一个问题:)