Advanced sorting question about drupal views I have a content type with latitude and longitude coordinate fields. i have a view that is displayed on each page with this content type, and a google map plotting the location. Is there any way to sort a view using the distance between points?

distance=( ( current_page_lat - view_item_lat) + ( current_page_lng - view_item_lng ) )
You will need help of views_php module. This module will help to sort views rows with a calculation. You need to go through.

But in your case, The calculation has a value from current page. So you have to get the current page value (lang, lat) in sorting field, may be you can use it as a global variable or call a function from inside the php field.

Hope this helps you. :)