简体   繁体   中英

Search by location using an array with geokit gem

I need to search on two or more locations

model = Model.in_range("0".."5",:origin => [LatLng, LatLng, LatLng, LatLng)

is posible?

You can chain multiple calls like:

model = Model.in_range("0".."5",:origin => [Lat1, Lng1]).in_range("0".."5",:origin => [Lat2, Lng2])

For deep reference, check the method at https://github.com/geokit/geokit-rails/blob/3a7b4e1083dd06d486307ebf71c36608186c8d73/lib/geokit-rails/acts_as_mappable.rb#L134

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM