I'm creating a view to find the closest node to the current viewed node. I try to add a proximity sort criterium but the location provider dropdown is empty. Am I missing any step?

PS. I put 6.x-2.x-dev as the version this issue refers as there's no option for the 7.x one!

Comments

robcarr’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

I think you have to unlock the node or string if you are using exposed filters

cesareaugusto’s picture

I think you have to unlock the node or string if you are using exposed filters

How can I do that?

robcarr’s picture

StatusFileSize
new95.77 KB
new13.03 KB

First add a filter for Proximity (either Square or Great-Circle model - take your pick):

Then configure it to be 'Exposed' and check the relevant boxes. Or select the 'Get location from a node' option which will give you a drop down of relevant nodes (it only adds nodes that contain relevant location data - all others are ignored).

For info, the check boxes seem a little buggy in how the exposed filter is rendered on the final View (ie, I seem to be able to still tweak regardless). I've only just discovered this module, so will be seeing if the 'Lock' bugs are down to finger issues my end, or if there is a fresh issue to raise in this module's queue

cesareaugusto’s picture

Perhaps I expressed wrong. I don't want the filter to be exposed. It should only take current node, then select its location as the base to compute distance from. The user shouldn't be able to choose its preferred base point.

robcarr’s picture

Ahhh. The holy grail of linking geo data to Views.

As of the moment, only the Location module makes this straightforward, but there are lots of other problems with using Location in a D7 site.

I had to resort to a very hacky custom module that grabbed the NID of the current page, then ran an SQL query to compare the 2 lat/lon values of each Views row to give me the '3 nearest'. The only way to properly implement this would be to add Views field and sort handler - way above my current expertise.

cesareaugusto’s picture

Yep Location sucks on D7. I was looking for some kind of proximity sorting module which would enable current node location as a relationship (perhaps).

arrubiu’s picture

the problem for me was that, building the index, this module does not find the geofield value because it was searching a "und" value but my value had the "it" value.
Today I try to modify the module also because some queries don't work on postgres.
And I try to add a functionality to set "center" node programmatically..

ghalenir’s picture

When do we get updates about this bug.

I also have the same issue.