lib/geokit-rails/acts_as_mappable.rb
# Alters the conditions to include rectangular bounds conditions.
Alters the conditions to include rectangular bounds conditions.
Alters the conditions to include rectangular bounds conditions .
def apply_bounds_conditions(options,bounds)
        sw,ne = bounds.sw, bounds.ne
        lng_sql = bounds.crosses_meridian? ? "(#{qualified_lng_column_name}<#{ne.lng} OR #{qualified_lng_column_name}>#{sw.lng})" : "#{qualified_lng_column_name}>#{sw.lng} AND #{qualified_lng_column_name}<#{ne.lng}"
        bounds_sql = "#{qualified_lat_column_name}>#{sw.lat} AND #{qualified_lat_column_name}<#{ne.lat} AND #{lng_sql}"
        options[:conditions] = merge_conditions(options[:conditions], bounds_sql)
      end
def apply_bounds_conditions ( options , bounds ) sw , ne = bounds . sw , bounds . ne lng_sql = bounds . crosses_meridian? ? "(#{qualified_lng_column_name}<#{ne.lng} OR #{qualified_lng_column_name}>#{sw.lng})" : "#{qualified_lng_column_name}>#{sw.lng} AND #{qualified_lng_column_name}<#{ne.lng}" bounds_sql = "#{qualified_lat_column_name}>#{sw.lat} AND #{qualified_lat_column_name}<#{ne.lat} AND #{lng_sql}" options [ :conditions ] = merge_conditions ( options [ :conditions ] , bounds_sql ) end
Alters the conditions to include rectangular bounds conditions.
Alters the conditions to include rectangular bounds conditions .
options
<not_specific>
bounds
<not_specific>