显示方向信息gmaps4rails

时间:2013-09-07 04:17:28

标签: ruby-on-rails ruby google-maps gmaps4rails

我可以使用gmaps4rails gem在我的rails应用中在地图上显示路线,但我无法在任何地方显示行车时间和距离等信息。

wiki讨论了如何显示一个小组,但我还没有让它工作。

<div id="instructions"></div>
<%= gmaps("map_options" => {
    "zoom" => 14,
    "auto_adjust" => false,
    "center_latitude" => @location.latitude,
    "center_longitude" => @location.longitude
  },
  "markers" => { "data" => @json },
  "direction"   => { 
    "data" => {
      "from" => @location.address,
      "to" => "Cleveland, OH"
    },
    "travelMode" => "DRIVING",
    "display_panel" => true,
    "panel_id" => "instructions"
  }) %>

0 个答案:

没有答案