Growstuff/growstuff — pull request #307 by Skud (2013-09-11 03:26:43+00:00)
Title: Places - finally fixed?

I've finished the required fixes on https://www.pivotaltracker.com/story/show/53848631

The biggest thing was to move all the maps functionality to happen in pure javascript as much as possible. We now fetch items to be mapped (i.e. members for now) via JSON from our own API at places.json and places/whatever.json, and also access Nominatim direct with Javascript in the browser (for places/show).

This also fulfils another story, https://www.pivotaltracker.com/story/show/47133737, "Improve nearby members so it always finds people and never finds too many people", as we now show up to 30 members in order of nearness. In other words, you'll always see stuff near you.

I've created a method, Member.nearest_to(place), which returns a list of members in order of nearness to the specified place. It does this by sorting by the Geocoder .distance_from method. This may be really slow at some time in future but I think for now it'll be OK.