Class: LayersOfLondon::Booth::MapTool::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/layers_of_london/booth/map_tool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#north_west_extentObject

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_extentObject

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_sizeObject

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_eastObject



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_westObject



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_eastObject



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_westObject



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_xObject



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_yObject



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