Project

maptastic

0.0
No commit activity in last 3 years
No release in over 3 years
The maptastic plugin for Ruby on Rails provides simple and unobtrusive helper methods and javascript libraries to integrate maps in web applications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 4.3.2
>= 0.1.12
>= 2.0.0.beta.18
>= 2.0.0.beta.18

Runtime

>= 3.0.0.rc
 Project Readme

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 © 2010 Benedikt Deicke. See LICENSE for details.