Class: LayersOfLondon::Booth::MapTool::Configuration
- Inherits:
-
Object
- Object
- LayersOfLondon::Booth::MapTool::Configuration
- Defined in:
- lib/layers_of_london/booth/map_tool.rb
Instance Attribute Summary collapse
-
#north_west_extent ⇒ Object
Returns the value of attribute north_west_extent.
-
#south_east_extent ⇒ Object
Returns the value of attribute south_east_extent.
-
#square_size ⇒ Object
Returns the value of attribute square_size.
Instance Method Summary collapse
- #north_east ⇒ Object
- #north_west ⇒ Object
- #south_east ⇒ Object
- #south_west ⇒ Object
- #squares_x ⇒ Object
- #squares_y ⇒ Object
Instance Attribute Details
#north_west_extent ⇒ Object
Returns the value of attribute north_west_extent.
18 19 20 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 18 def north_west_extent @north_west_extent end |
#south_east_extent ⇒ Object
Returns the value of attribute south_east_extent.
18 19 20 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 18 def south_east_extent @south_east_extent end |
#square_size ⇒ Object
Returns the value of attribute square_size.
18 19 20 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 18 def square_size @square_size end |
Instance Method Details
#north_east ⇒ Object
28 29 30 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 28 def north_east @north_east ||= Geokit::LatLng.new(north_west.lat, south_east.lng) end |
#north_west ⇒ Object
20 21 22 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 20 def north_west @north_west ||= Geokit::LatLng.new(*@north_west_extent) end |
#south_east ⇒ Object
24 25 26 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 24 def south_east @south_east ||= Geokit::LatLng.new(*@south_east_extent) end |
#south_west ⇒ Object
32 33 34 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 32 def south_west @south_west ||= Geokit::LatLng.new(south_east.lat, north_west.lng) end |
#squares_x ⇒ Object
36 37 38 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 36 def squares_x @squares_x ||= (north_west.distance_to(north_east, units: :meters) / @square_size).ceil end |
#squares_y ⇒ Object
40 41 42 |
# File 'lib/layers_of_london/booth/map_tool.rb', line 40 def squares_y @squares_y ||= (north_west.distance_to(south_west, units: :meters) / @square_size).ceil end |