Posted by pcbudde on January 5, 2013 at 1:40pm
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
Comments
geofield proximity in views
Hi pcbudde,
At first I also received only zeroes in the proximity field.
I had created an addressfield field for user location, as well as a geofield field which used that addressfield to store geocoded data.
In views, I set the "Geocoded Location - proximity" settings to:
Round: [checked]
Source of Origin: Current User
Source Field: [name of geocoded user field]
Still zero; I returned to my test user page and manually entered a location (rather than relying on Smart IP/automatic geolocation) and saved the data.
I also succeeded in adding a contextual filter for User Location:
- Selected filter: Global: Null
- Selected "Provide Default Value" for "When the filter value is NOT in the URL:"
- For Default Value type, selected in dropdown menu:
Visitor location attribute (via IP Geolocation)
- For "Location attribute to use," selected "Postal Code."
After updating user data and adding the contextual filter, I received non-zero results for the proximity field.
However, deleting the filter did not change results, so I believe it was the newly-saved user data that made a difference.
Hope this helps in your troubleshooting.