Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sunbo/cartographer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

Cartographer generates painless Google Maps for your Rails application.
In your controller:
def index
 @spots = Spot.find(:all) # Your Geocoded location model
 @map = Cartographer::Gmap.new("spots", :zoom => :bound, :controls => [:small,:scale], :debug => true)
 @spots.each do |spot|
 @map.markers << Cartographer::Gmarker.new(:name => "spot_" + spot.id.to_s, :position => [spot.lat, spot.lng], :info_window => spot.description)
 end
end
In your view
 <%= @map.to_html %>
You will need:
A Google Maps API key (put it in config/cartographer-config.yaml)
Geocoded locations (easily done with Geokit -- http://geokit.rubyforge.org/)
Current Version:
v0.1 08 May 2008
* Original Rubyforge version with some small edits
History:
Original Rails blog announcement is at http://download.rubyonrails.com/2005/8/30/cartographer-effortless-google-maps-in-rails, but the Rubyforge project page is dead. So I'm bringing it back.

About

Google Maps on Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /