Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To have the distance filter; please make sure to have the geocoder module; https://www.drupal.org/project/geocoder
To view the distance value; In the settings for the LatLong pair field check the box Show distance instead of coordinates.
Comments
Doesn' work :-)
Sorry but I don not get this field "distance" in the filter. Any idea why?
I am using geofield... Thanks!
De Feyter Frédéric - Thatsit.be
Me too :'(
Experiencing the same lack of field.
i'm only able to set the label of filter operator if I expose it.
Any news?
Have you found a fix, workaround or anything comparable for this problem?
Is this possible for the
Is this possible for the address to use the Google autocomplete form?
thanks
Autocomplete function
@pinkonomy, did you find a solution for your problem? I'm looking for something simular...
Sorry I didn't find how to do
Sorry I didn't find how to do this,if you found it please post here,thanks
Need to have distance
I just need to have a field which calculates the distance between the entered zip code and its nearby location. Same as the google map directions.
I am unable to find out the same.
Can someone please help me in this?
Thanks
Danish
found a solution
Hi Have used the below php code to find the distance between two points:-
function distance($lat1, $lon1, $lat2, $lon2, $unit) {
$theta = $lon1 - $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$miles = $dist * 60 * 1.1515;
$unit = strtoupper($unit);
if ($unit == "K") {
return ($miles * 1.609344);
} else if ($unit == "N") {
return ($miles * 0.8684);
} else {
return $miles;
}
}
We just needs to pass the lat and long of both the points. Gives a pretty accurate results.
Did you find any solution for this issue?
I am using geofield 7.x-2.3 but not getting this filter criterion in views.
Distance Filter
To have the distance filter; please make sure to have the geocoder module; https://www.drupal.org/project/geocoder
To view the distance value; In the settings for the LatLong pair field check the box Show distance instead of coordinates.