]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/swf_controller.rb
Fixed error handling in the name search and tidied things up a bit.
[rails.git] / app / controllers / swf_controller.rb
index cd9bf182323c7fc93b42223a5e72e12718ad7740..a58e899e01741d0daeec900a210de98587a20a0a 100644 (file)
@@ -99,6 +99,7 @@ class SwfController < ApplicationController
                                " WHERE (cn1.longitude BETWEEN #{xmin} AND #{xmax})"+
                                "   AND (cn1.latitude  BETWEEN #{ymin} AND #{ymax})"+
                                "   AND segment_id IS NULL"+
+                               "   AND current_segments.visible=1"+
                                "   AND cn1.id=node_a AND cn1.visible=1"+
                                "   AND cn2.id=node_b AND cn2.visible=1"
                        seglist=ActiveRecord::Base.connection.select_all sql
@@ -138,8 +139,7 @@ class SwfController < ApplicationController
                m=packRect(bounds_left,bounds_right,bounds_bottom,bounds_top) + 0.chr + 12.chr + packUI16(1) + m
                m='FWS' + 6.chr + packUI32(m.length+8) + m
        
-               response.headers["Content-Type"]="application/x-shockwave-flash"
-               render :text=>m
+               render :text => m, :content_type => "application/x-shockwave-flash"
        end
 
        private