I used to have a taxonomy list for node locations as well as a gmap for showing all nodes on one, main map.
I now trying to get rid of this extra work (entering locations twice) and thought I'd try using the proximity view to allow users to find nodes close to the current one (I figure they can just use the main map to find nodes anywhere else) as opposed to selecting taxonomy terms.

What I'd like to know is how to do this.
I can setup a view in a block to display on node pages with the proximity filter, but how do I set the lat./long. to the current node automatically?

Any help would be much appreciated!

Comments

BWPanda’s picture

Still looking for help with this if possible...

BWPanda’s picture

Anyone?

malcomio’s picture

I was hoping to achieve the same, possibly by using relationships or arguments, but none of the location stuff appears in arguments

haven't managed to figure it out yet - can anyone help?

chaosprinz’s picture

Subscribing
I am searchin for a similar solution for user-locations. I tried with arguments, and i tried to give relationship to the filter, but nothing worked.

andrewsuth’s picture

Component: Miscellaneous » Code
Category: support » feature

You're right, I am using the current dev version and the options for this are:

Origin:

  • User's location (blank if unset)
  • User's location (fall back to static if unset)
  • Static location
  • Use Distance / Proximity filter

And below these options there is a tiny FIXME written .. perhaps this has already been thought about?

+1 for current node added to Origin. I'd just love to be able to inform the users of the distance from the current node to other nodes.

This idea makes too much sense not to be added to the module.

srobert72’s picture

Subscribing

I'd want to show GMap for my current node.
On this map I'd like to show only other nodes with less a certain distance from current node.

Views proximity filter from current node would be great !

dpatte’s picture

I have just suceeded at being able to calculate the distance from users to any node, using the user location feature. If this is what you want, maybe I can help.

Unfortunately, if the user provides no location in his profile it seems to show no distance even with the fallback option selected.

fletch11’s picture

This sounds like it would be useful for social networking type sites but I think the proximity to node filter/argument/relationship would be more useful for sites that do not require registration. Still looking for a solution to this. thanks

dpatte’s picture

I was messing around today and found a solution to a view proximity bug. The option 'User's location (fall back to static if unset)' does not fall back to static as expected in the sort or field parts of views.

In the version of Location I am using:

In location_handler_field_location_distance.inc, function query() - near line 88
and location_handler_sort_location_distance.inc, function query - near line 72 (both in the location module)

I have added the following lines of code

      else if ($this->options['origin'] == 'hybrid') {
        $latitude = (float)$this->options['latitude'];
        $longitude = (float)$this->options['longitude'];
      }

This is the else case for user if the user location is not available.

There may be more efficient ways of handling the code for this fix, but the above solution now works for me at my site at www.dance-ottawa.com

BTW: I'm not sure how the owners of this module wish me to package this correctly so that it can be submitted for the next build.

j0k3z’s picture

The "FIX ME" has been there for over 6 months now.

I want to have a block shown on a specific node that shows 10 nearby nodes. Seems pretty simple to do but not using the current code base. Im not much of a coder but I would like to contribute if possible to help solve this problem.

j0k3z’s picture

Has anyone figured out how to hack this together?

j0k3z’s picture

Priority: Normal » Critical
Exploratus’s picture

Anybody figure out how to create a map that shows the nearest nodes to a specific node?

brewern’s picture

lolandese’s picture

Status: Closed (fixed) » Fixed

The original post:
...a view in a block to display on node pages with the proximity filter, but how do I set the lat./long. to the current node automatically?

This seems to be solved now. See a working example.

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Summit’s picture

Status: Fixed » Closed (fixed)

Bookmarking, greetings, Martijn