Files
mapknitter/app/controllers/utility_controller.rb
Cess 0a8813cc87 (WIP)Move some controller code to models (#519)
* Remove trailing white spaces and unnecessary blank lines

* Remove basic rubocop offenses

* add few maps  tests

* refactor maps controller

* fix 'line too long' rubocop offense
2019-04-15 20:42:28 -05:00

11 lines
311 B
Ruby

class UtilityController < ApplicationController
# translates TMS formats from one ordering to another
def tms_alt
# /z/x/y.png
# /z/x/y.png
# /z/x/(2*z-y-1).png
y = 2**params[:z].to_i - params[:y].to_i - 1
redirect_to "/tms/#{params[:id]}/#{params[:z]}/#{params[:x]}/#{y}.png"
end
end