]> git.openstreetmap.org Git - rails.git/commitdiff
be a bit smarter about enlarging the bbox (note to self: must remember to put this...
authorRichard Fairhurst <richard@systemed.net>
Fri, 13 Feb 2009 15:12:52 +0000 (15:12 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 13 Feb 2009 15:12:52 +0000 (15:12 +0000)
app/controllers/amf_controller.rb

index 2b21221c0b5e560efaa5d4be1f4c191582d52961..febc4db68cc6a1464e02c00bd504e739f4a587fd 100644 (file)
@@ -126,8 +126,9 @@ class AmfController < ApplicationController
   # are IDs only. 
 
   def whichways(xmin, ymin, xmax, ymax) #:doc:
   # are IDs only. 
 
   def whichways(xmin, ymin, xmax, ymax) #:doc:
-       xmin -= 0.01; ymin -= 0.01
-       xmax += 0.01; ymax += 0.01
+       enlarge = [(xmax-xmin)/8,0.01].min
+       xmin -= enlarge; ymin -= enlarge
+       xmax += enlarge; ymax += enlarge
 
        if POTLATCH_USE_SQL then
          way_ids = sql_find_way_ids_in_area(xmin, ymin, xmax, ymax)
 
        if POTLATCH_USE_SQL then
          way_ids = sql_find_way_ids_in_area(xmin, ymin, xmax, ymax)