开发者

Rails Geocoder Function

With the geocoder gem, if I wanted to find pictures nearby one particular picture by a mile I could do开发者_开发知识库 pictures.nearby(1) but what if I had a user with a location and wanted to find pictures nearby my user, how would I do that


Instead of nearby() you can use

Pictures.near([u.lat, u.lon], 1)    # venues within 1 miles of a user

See GitHub/geocoder

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜