public/javascripts/vendor/javascripts/geolib.js
function(latlng, coords, offset) {

			offset = offset || 0;
			var ordered = geolib.orderByDistance(latlng, coords);
			return ordered[offset];

		}
function(latlng, coords, offset) {

			offset = offset || 0;
			var ordered = geolib.orderByDistance(latlng, coords);
			return ordered[offset];

		}
function ( latlng , coords , offset ) { offset = offset || 0 ; var ordered = geolib . orderByDistance ( latlng , coords ) ; return ordered [ offset ] ; }
Finds the nearest coordinate to a reference coordinate

@param		object		reference coordinate e.g. {latitude: 51.5023, longitude: 7.3815}
@param		mixed		array or object with coords [{latitude: 51.5143, longitude: 7.4138}, {latitude: 123, longitude: 123}, ...]
@return		array		ordered array
Finds the nearest coordinate to a reference coordinate