Sorting results by distance from location

Hi,

I wanted to know if it’s possible to sort results according to their distance from the location passed as a parameter.
As location is not of a type accepted by sorting parameter and it’s not a selectable field in weight administration panel, I was wondering if there is any other way.

Thanks in advance for your help!