]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
Use BETWEEN for the node selection in the map API call as MySQL seems to
[rails.git] / app / controllers / api_controller.rb
index 7e8017f4e3736dabf1471d6d1f6730f045506ad5..407f6872afe6ec11d6d1c375e8bff98ee1222ea3 100644 (file)
@@ -141,7 +141,7 @@ class ApiController < ApplicationController
     end
 
     # get all the nodes
-    nodes = Node.find(:all, :conditions => ['latitude > ? AND longitude > ? AND latitude < ? AND longitude < ? AND visible = 1', min_lat, min_lon, max_lat, max_lon])
+    nodes = Node.find(:all, :conditions => ['latitude BETWEEN ? AND ? AND longitude BETWEEN ? AND ? AND visible = 1', min_lat, max_lat, min_lon, max_lon])
 
     node_ids = nodes.collect {|node| node.id }