2 def initialize(min_lon, min_lat, max_lon, max_lat)
3 @bbox = [min_lon.to_f, min_lat.to_f, max_lon.to_f, max_lat.to_f]
7 BoundingBox.new(*s.split(/,/))
43 (@bbox[0] + @bbox[2]) / 2.0
47 (@bbox[1] + @bbox[3]) / 2.0
58 def slippy_width(zoom)
59 width * 256.0 * 2.0 ** zoom / 360.0
62 def slippy_height(zoom)
63 min = min_lat * Math::PI / 180.0
64 max = max_lat * Math::PI / 180.0
66 Math.log((Math.tan(max) + 1.0 / Math.cos(max)) / (Math.tan(min) + 1.0 / Math.cos(min))) * 128.0 * 2.0 ** zoom / Math::PI
70 return @bbox.join(",")