Method: MapKit::ZoomLevel::ClassMethods#longitude_to_pixel_space_x

Defined in:
lib/map-kit-wrapper/zoom_level.rb

#longitude_to_pixel_space_x(longitude) ⇒ Object

Convert longitude to pixel space x

  • Args :

    • longitude -> Int or Float

  • Returns :

    • Pixel space x as Int



36
37
38
# File 'lib/map-kit-wrapper/zoom_level.rb', line 36

def longitude_to_pixel_space_x(longitude)
  (MERCATOR_OFFSET + MERCATOR_RADIUS * longitude * PI / 180.0).round
end