I made a nice implementation of counting the proximity of a user to some location in Bali using the modules geofield (in business nodes) + geocoder + ip_geoloc (IP Geolocation Views & Maps) - for geolocation of users and displaying the maps +geolocation proximity.

Thank you!

Now I am trying to understand if I can count somehow the distance between two users.

So, if I can enter the user's profile I can see in how many kilometers they are from me.

The problem is that if I use ip_geoloc (IP Geolocation Views & Maps) for geolocation there is no need for a user to set the location in a field. The geolocation works on the fly.

But I cannot measure the distance between users if there is no data in the fields. Can't I?

Thank you in advance!

Comments

leramulina created an issue. See original summary.

leramulina’s picture

Issue summary: View changes
RdeBoer’s picture

When using IPGV&M+Geofield all distances are measured from the nodes (or other entities like users) that have a Geofield on them, to some reference/source point.
That reference/source point is either a fixed point or the visitor's location.
So, if you put a Geofield on the user profile then you can put all users on a map and show the distance from each user to the visitor.

If you want to measure the distance between two arbitrary entities (users, nodes, taxonomy terms) then you'll have to find a way to define the reference/source point to be the second entity. You could do this by extending the "Set my location" block with a 4th mode/option to select a user/node [It already has 3 modes].

For inspiration, here's the "Set my location" block in action in 3 modes: "Find me", select a region from a drop-down and "teleport" to a address you type.
http://regionbound.com/coffee-prices-across-melbourne

leramulina’s picture

Thank you for your answer!

"So, if you put a Geofield on the user profile then you can put all users on a map and show the distance from each user to the visitor".

Yes, I can do this. But it means that every time the users will have to set their location manually. Right?

"You could do this by extending the "Set my location" block with a 4th mode/option to select a user/node [It already has 3 modes]".

Sorry. I did not really understand. What do you mean?

RdeBoer’s picture

RE: But it means that every time the users will have to set their location manually. Right?
No. See http://flink.com.au/tips-tricks/map-of-mobile-users-updated-automatically

Regarding the last remark. I thought you wanted to know all distances from every user to every other user. Like a matrix of distances?

If that's not the case, and you only want to see the distances from one source location (entered as an address, a region taxonomy or the visitor's current GPS/Wifi-retrieved position), then you don't need to extend the "Set my location" block with that option.