Skip to content

Commit

Permalink
Improve picture distribution for Issue johnmckerrell#14
Browse files Browse the repository at this point in the history
Changing size of grouping rectangle, so exactly FIND_IN_AREA_LIMIT fits
on the screen.

Signed-off-by: Radek Dostal <rd@radekdostal.com>
  • Loading branch information
dasty committed Jan 16, 2013
1 parent dc6a3b3 commit 8a22958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/photo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def self.find_in_area(bbox)
return
end
bits.map! { |b| b.to_f }
lat_step = (bits[1] - bits[3]) / 400
lon_step = (bits[0] - bits[2]) / 300
lat_step = (bits[1] - bits[3]) / Math.sqrt(FIND_IN_AREA_LIMIT)
lon_step = (bits[0] - bits[2]) / Math.sqrt(FIND_IN_AREA_LIMIT)
Photo.find( :all,
:conditions => [
"lat IS NOT NULL AND lon IS NOT NULL AND lat >= ? AND lat <= ? AND lon >= ? AND lon <= ? AND status = 'available'",
Expand Down

0 comments on commit 8a22958

Please sign in to comment.