Skip to content
This repository

Simple and unobtrusive map integration plugin for Ruby on Rails

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 autotest
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 maptastic.gemspec
README.rdoc

maptastic

The maptastic plugin for Ruby on Rails provides simple and unobtrusive helper methods and javascript libraries to integrate maps in web applications.

Requirements

Maptastic currently only works with Google Maps and Prototype. This might change in the future but for now that's how it is.

Install

To install the maptastic gem, simply add it to your Gemfile:

gem 'maptastic'

In order to get the latest development version of maptastic:

gem 'maptastic', :git => 'git://github.com/benedikt/maptastic.git'

and run

bundle install

Afterwards you can run the generator to get the necessary files installed into your application

rails generate maptastic:install

To include the required javascripts put these two lines in your application.html.erb

<%= maptastic_provider_tag %>
<%= javascript_include_tag 'maptastic' %>

To finalize the installation please set your defaults in config/initializers/maptastic.rb

Configuration

To configure maptastic to your needs edit the config/initializers/maptastic.rb file.

Usage

Read the API documentation at benedikt.github.com/maptastic/doc

Examples (without markers):

<%= maptastic :center => [37.4419, -122.1419] %>
<%= maptastic :center => @poi %> # @poi.latitude and @poi.longitude are used

Examples (with markers):

<%= maptastic @poi %> # Simple marker without info window
<%= maptastic @pois do |poi| %>
  Generates a marker with info window (bubble). Uses @poi.latitude and @poi.longitude
  to position the marker.
  <%= poi.name %>
<% end %>

Available options:

<%= maptastic :center => [37.4419, -122.1419], :zoom => 10; :controls => true %>

Copyright

Copyright © 2010 Benedikt Deicke. See LICENSE for details.

Something went wrong with that request. Please try again.