Scott, I got this working over lunch.. I can send a demo app if you want. Here's the basics using the YM4R/GM plugin:
The plugin from fork listed below assumes you have a javascript function named handleErrors(). You can just put a dummy function in your application.js file or use the javascript from here (view the source):
http://code.google.com/apis/maps/documentation/examples/directions-advanced.html
You have to add some things to your layout file....
The html tag needs some google stuff:
<html xmlns="
http://www.w3.org/1999/xhtml" <%= GMap::VML_NAMESPACE %> >
In your head section add:
<%= GMap.header %>
<%= @map.to_html %>
Example controller action:
class MapsController < ApplicationController
def index
points = [[45.554067,-122.675829],
[45.5517378,-122.6755129],
[45.549588,-122.67511],
[45.548305,-122.675558],
[45.540794,-122.675448]]
@map = GMap.new("map_div")
@map.center_zoom_init([45.549588,-122.67511], 13)
@map.directions('map_directions',points)
end
end
Example view:
<h2>GMap with Directions</h2>
<%= @map.div(:width => 400, :height => 400) %>
<div id='map_directions'>
</div>
.. and you need a gmaps config YAML file (the below works for localhost):
development: ABQIAAAAzMUFFnT9uH0xq39J0Y4kbhTJQa0g3IQ9GZqIMmInSLzwtGDKaBR6j135zrztfTGVOm2QlWnkaidDIQ