Ive been trying to setup a view where the distance to users is stated.
There has recently been an update of geofield however I am having trouble with calculating the distances to users (only get a zero)
I have checked whether the users have points, which they do, and tried to create a relationship to the user id without results.
I am a newbee in views so every advice would be beneficial
MotoTribe's answer is basically correct, but you might want to use the dev release instead of the alpha release. We've had a few bug fixes in since then. We should probably do a new release soon.
Source: Geofield maintainer.
See new documentation page for geofield that shows how to setup a basic proximity search (it is based on MotoTribe's answer, but with a bit more info)
As requested, some of the link content:
You must download the latest modules. These instructions have been tested with the 'dev' versions of geocoder, geofield, and addressfield modules. I believe these modules have a dependency on geophp, maybe others, install any dependent modules that you are instructed to when installing. Make sure to download the 'dev' versions!
Setup your content type:
That was easy! Now, let's setup the view result...
Setup your views query:
Looks pretty straightforward using geofield 7.x-2.0-alpha2:
I assume you have geofield and geophp enabled and assume you have added a geofield to your users that get the location from an addressfield.
In your example you would probably change the "source of origin point" to "current user".
Juts in case, i wrote a little plugin, it works on the alpha2 release.
I provide a simple proximity filter that use the Smart IP location information (so Smart IP is requiered). User just have to chek a box to search around him. Nice, isn't it ?
Disclaimer : I provide this code as is, i'm not responsible, etc. ;) And i post this under the control of the Maintainers, who can tell me that this is a sh** if it is the case.
See this comment for complete instructions : http://drupal.org/node/1901750#comment-7191652
In addition to RogerRoger's post:
In case you're using this as a Views attachment, don't forget to check "Inherit exposed filters" in the attachment settings, or it will only display the distance from the default value, or "0" in case there's no given default value.