Formtastic extension for selecting locations on a Google Map
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind MattHall:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets/javascripts
lib/maptastic
tasks
test
MIT-LICENSE
README.markdown
Rakefile
init.rb
install.rb
uninstall.rb

README.markdown

Formtastic Location Selector

Installation

First, you'll need to install Formtastic.

Next, install Maptastic as a plugin:

script/plugin install git@github.com:MattHall/maptastic.git

...and run the ake task to install the required js file into your javascripts directory. You will probably need to include this in your layouts, too.

rake maptastic:install

You'll need to add the Google Maps V3 script include in your page, above your semantic_form:

<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script>

Note that you no longer need an API key with the latest Google Maps release.

Usage

Maptastic adds a new #multi_input method as well as the map control:

<% semantic_form_for @venue do |f| %>
  <%= f.multi_input :latitude, :longitude, :as => :map %>
<% end %>

Note that the map input expects two parameters - a latitude and longitude. The order is important.

Development

This plugin is under development. It's pretty simple, and patches are very welcome.

The Repo is available on GitHub

Report bugs here

A testbed app is available to check that the changes made actually work as expected.

Project Info

Copyright © 2010 Matthew Hall, released under the MIT license.