/** * return the Distance to the given location */ public function getDistanceFromLocation(Location $location, $scale = 'km') { return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $location->getLatitude(), $location->getLongditude(), $scale); }
/** * return the Distance to the given */ public function getDistance($lat, $lng, $scale = 'km') { return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $lat, $long, $scale); }
public function getDistance() { return round(GeoFunctions::getDistance(Member::currentUser()->obj('Location')->getLatitude(), Member::currentUser()->obj('Location')->getLongditude(), $this->owner->obj('Location')->getLatitude(), $this->owner->obj('Location')->getLongditude())) . ' km'; }