How do you embed a proximity view and pass the node latitude, longitude, distance and measurement type.

The below was posted on views issue support but told to post here.

I have a proximity search view using latitude and longitude. How can I embed the view and pass the cck location coordinates to the view as arguments. In firefox using firebug I can see that the lat and long are being passed as distance[latitude]=46&distance[longitude]=-122 but don't know how to pass it as an embedded argument or even make it work using the argument test area in the view edit page. The search is setup right, I can expose a filter and all is well. I just can't get the embeded part.

This is the embed snippet I use for another embed view but don't know how to insert the lat long stuff.

global $current_view;
// * define the context-node's NID as the argument
$current_view->args[0]=$node->nid;
$myview = views_embed_view("local_stores", "default", $current_view->args );

The missing parts :(

$node->locations[0]['latitude'] ?> goes somewhere?
$node->locations[0]['longitude'] ?> goes somewhere?
$distance= 10 (I guess this might be a default setting doesn't need to change?)
$measurement = miles (I guess this might be a default setting doesn't need to change?)

Thank you

Comments

pwieck’s picture

Anyone??? Help a beginner??? I have many drupal books but none talk about this kind of stuff.

Maybe a SQL snippet for 6.x that does the same thing without views2

SELECT nodes that are within 5 mile of current node lat and lon ORDER BY distance.
Show in a table the node title with link and the miles, maybe a couple fields from those nodes also.

Thanks

YesCT’s picture

farald’s picture

Status: Active » Closed (duplicate)

Marking this post as a duplicate of #357295 mentioned in previous comment.
Location proximity search by arguments is a work-in-progress.