我可以使用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"
}) %>