OK, so here's my scenario:
Each user has a location. to achive this I got the content_profile installed. This way, I could assign an OpenLayers Geocoder CCK field to users using a new content type.
Next, I want to display in a map the users that are near the user viewing the map. To do this I setup a view that displays all users on a map.
Next I wrote this:
<?php
global $user;
$sql = db_query("SELECT node.uid, content_type_profile.field_location_wkt_openlayers_wkt AS userlocation
FROM node
INNER JOIN content_type_profile ON node.nid = content_type_profile.nid WHERE node.uid = %d", $user->uid);
while ($row = db_fetch_object($sql)) {
$output .= $row->userlocation;
}
echo $output;
?>that actually outputs the location of the current user in the form of
GEOMETRYCOLLECTION(POINT(X Y)) where X and Y are the coordinates.
What I need to do now is filter my view using the proximity filter and on the "Configure filter Proximity: Great-circle" page, declare as a location the one that the above code returns.
I couldn't find a way to do it... can anyone help?
Comments
Comment #1
aristeides commentedcorrection... the view is not a user view but a node view that displays profiles.
Comment #2
aristeides commentedOk, I realize this can't be done using the UI of OL Proximity filter, but still, it could be done by hacking the OL Proximity module file, right?
Comment #3
aristeides commentedAnyone? I could really use some help here...
Comment #4
scalp commentedaristeides,
The only way I've tried doing something similar to this is by building the view through something like "Advanced Front Page" module. That way you can use something like:
This will set up the view to show results that are in a 30 mile circle from the logged in user's content profile location.
At least that got it working for me.
Comment #5
scottrigbyIs there any interest in supporting user type views?
The ideal way to do this in views normally is a user type view (allows exposed filters on fields from multiple content_profile types). Currently a user view gives results like:
Edit: this part was because i had the filter in twice.warning: Illegal offset type in /openlayers_proximity/views/openlayers_proximity_handler_filter.inc on line 271user warning: Unknown column 'node_users__openlayers_proximity_filter_circle.distance' in 'field list'…in /views/plugins/views_plugin_pager.inc on line 141andin /views/plugins/views_plugin_query_default.inc on line 1150.Comment #6
petednz commentednot for me - but this is the only thread i see that seems to raise the issue of using proximity with Views types other than nodes. My goal would be to have it work with civievent (civicrm) type since these have their own Lat Long fields. So are we both asking about what is involved in having Proximity work with non-node view types?
I should have said that problem I am finding is the Proximity just doesn't show under 'Groups' in Filters at all. So I should probably fire this off as a separate issue.