You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
622 B

class MapsController < ApplicationController
def index
@maps = Map.all
respond_to do |format|
format.html
format.xml { render :xml => @maps }
end
end
def show
@map = Map.find(params[:id])
respond_to do |format|
format.png do
GoogleMapLocationFetcher.new.fetch([@map.name]) do |loc,image|
dest = Rails.root.join("public/maps/#{@map.id}.png")
FileUtils.mkdir_p(File.dirname(dest))
File.open(dest, 'w') do |f|
f.write(image)
end
send_file(dest, :type => 'image/png')
end
end
end
end
end