mirror of
https://github.com/publiclab/mapknitter.git
synced 2026-01-08 16:35:25 +01:00
* Adjust TMS redirects for google cloud, new route redirect style * Update utility_controller.rb * Apply suggestions from code review * Update _cloud_exports.html.erb * Update tms_info.html.erb * Delete utility_controller_test.rb * Update routes.rb * Update utility_controller.rb * Update app/controllers/utility_controller.rb * Update utility_controller.rb * Update .codecov.yml * Update _cloud_exports.html.erb
12 lines
597 B
Ruby
12 lines
597 B
Ruby
class UtilityController < ApplicationController
|
|
# TMS redirects now handled mostly in config/routes.rb
|
|
|
|
# most export TMS routes are handled in app/views/maps/_cloud_exports.html.erb, but this may catch some too
|
|
# if no static local file exists in format /tms/:id/:z/:x/:y.png, this action handles the request
|
|
def tms
|
|
unless Map.find_by(slug: params[:id]) # if no map with the given slug is found, record_not_found is thrown
|
|
redirect_to("https://mapknitter-exports-warps.storage.googleapis.com/#{params[:id]}/tms/#{params[:z]}/#{params[:x]}/#{params[:y]}.png")
|
|
end
|
|
end
|
|
end
|