Browse Source

important geocoder fix

euromark 13 years ago
parent
commit
20fdb31b8f
2 changed files with 2 additions and 3 deletions
  1. 0 1
      Lib/Utility/TimeLib.php
  2. 2 2
      Model/Behavior/GeocoderBehavior.php

+ 0 - 1
Lib/Utility/TimeLib.php

@@ -222,7 +222,6 @@ class TimeLib extends CakeTime {
 		return date("t", mktime(0, 0, 0, $month, 1, $year));
 	}
 
-
 	/**
 	 * Calendar Week (current week of the year)
 	 * @param date in DB format - if none is passed, current day is used

+ 2 - 2
Model/Behavior/GeocoderBehavior.php

@@ -238,8 +238,8 @@ class GeocoderBehavior extends ModelBehavior {
 
 		return $value . ' * ACOS( COS( PI()/2 - RADIANS(90 - '.$modelName.'.'.$fieldLat.')) * ' .
 			'COS( PI()/2 - RADIANS(90 - '. $lat .')) * ' .
-			'COS( RADIANS('.$modelName.'.'.$fieldLat.') - RADIANS('. $lng .')) + ' .
-			'SIN( PI()/2 - RADIANS(90 - '.$modelName.'.'.$fieldLng.')) * ' .
+			'COS( RADIANS('.$modelName.'.'.$fieldLng.') - RADIANS('. $lng .')) + ' .
+			'SIN( PI()/2 - RADIANS(90 - '.$modelName.'.'.$fieldLat.')) * ' .
 			'SIN( PI()/2 - RADIANS(90 - '. $lat . ')))';
 	}