class Gpx2png::OsmBase
Constants
- TILE_HEIGHT
- TILE_WIDTH
Public Class Methods
licence_string()
click to toggle source
# File lib/gpx2png/osm_base.rb, line 29 def self.licence_string "Map data OpenStreetMap (CC-by-SA 2.0)" end
url(zoom, coord, server = 'b.')
click to toggle source
Convert OSM tile coords to url
# File lib/gpx2png/osm_base.rb, line 23 def self.url(zoom, coord, server = 'b.') x, y = coord url = "http://#{server}tile.openstreetmap.org\/#{zoom}\/#{x}\/#{y}.png" return url end
url_convert(zoom, coord, server = 'b.')
click to toggle source
Convert latlon deg to OSM tile url TODO add algorithm to choose from diff. servers
# File lib/gpx2png/osm_base.rb, line 17 def self.url_convert(zoom, coord, server = 'b.') x, y = convert(zoom, coord) url(zoom, [x, y], server) end