class SphericalMercator
- SphericalMercator
- Reference
- Object
Defined in:
sphericalmercator.crConstant Summary
- 
        A = 6378137.0
- 
        900913 properties. 
- 
        D2R = Math::PI / 180
- 
        DEFAULT_SIZE = 256.as(Int32)
- 
        MAXEXTENT = 20037508.342789244
- 
        R2D = 180 / Math::PI
- 
        VERSION = "0.1.0"
Constructors
Instance Method Summary
- 
        #bbox(x, y, zoom, tms_style = false, srs = "WGS84")
        
          Convert tile xyz value to bbox of the form [w, s, e, n]-x{Number} x (longitude) number.
- 
        #convert(bbox, to = "WGS84")
        
          Convert projection of given bbox. 
- 
        #forward(ll)
        
          Convert lon/lat values to 900913 x/y. 
- 
        #inverse(xy)
        
          Convert 900913 x/y values to lon/lat. 
- 
        #ll(px, zoom)
        
          Convert screen pixel value to lon lat 
- #px(ll, zoom)
- 
        #xyz(bbox, zoom, tms_style = false, srs = "WGS84")
        
          Convert bbox to xyx bounds 
Constructor Detail
Instance Method Detail
Convert tile xyz value to bbox of the form [w, s, e, n]
- x{Number} x (longitude) number.
- y{Number} y (latitude) number.
- zoom{Number} zoom.
- tms_style{Boolean} whether to compute using tms-style.
- srs{String} projection for resulting bbox (WGS84|900913).
- return{Array} bbox array of values in form- [w, s, e, n].
        
        def convert(bbox, to = "WGS84")
        #
      
      
        Convert projection of given bbox.
- #bbox{Number} bbox in the form- [w, s, e, n].
- to{String} projection of output bbox (WGS84|900913). Input bbox assumed to be the "other" projection.
- @return{Object} bbox with reprojected coordinates.
        
        def ll(px, zoom)
        #
      
      
        Convert screen pixel value to lon lat
- #px{Array}- [x, y]array of geographic coordinates.
- zoom{Number} zoom level.
Convert bbox to xyx bounds
- #bbox{Number} bbox in the form- [w, s, e, n].
- zoom{Number} zoom.
- tms_style{Boolean} whether to compute using tms-style.
- srs{String} projection of input bbox (WGS84|900913).
- @return{Object} XYZ bounds containing minX, maxX, minY, maxY properties.