Index: trunk/extensions/Maps/ParserFunctions/GeoFunctions/Maps_GeoFunctions.php |
— | — | @@ -279,10 +279,10 @@ |
280 | 280 | * @return array The desitination coordinates, as non-directional floats in an array with lat and lon keys. |
281 | 281 | */ |
282 | 282 | public static function findDestination( array $startingCoordinates, $bearing, $distance ) { |
283 | | - $startingCoordinates['lat'] = (float)$startingCoordinates['lat']; |
284 | | - $startingCoordinates['lon'] = (float)$startingCoordinates['lon']; |
| 283 | + $startingCoordinates['lat'] = deg2rad( (float)$startingCoordinates['lat'] ); |
| 284 | + $startingCoordinates['lon'] = deg2rad( (float)$startingCoordinates['lon'] ); |
285 | 285 | |
286 | | - $angularDistance = $distance / Maps_EARTH_RADIUS; |
| 286 | + $angularDistance = deg2rad( $distance / Maps_EARTH_RADIUS ); |
287 | 287 | |
288 | 288 | $lat = asin( |
289 | 289 | sin( $startingCoordinates['lat'] ) * cos( $angularDistance ) + |
— | — | @@ -290,10 +290,10 @@ |
291 | 291 | ); |
292 | 292 | |
293 | 293 | return array( |
294 | | - 'lat' => $lat, |
295 | | - 'lon' => $startingCoordinates['lon'] + atan2( |
| 294 | + 'lat' => rad2deg( $lat ), |
| 295 | + 'lon' => rad2deg( $startingCoordinates['lon'] + atan2( |
296 | 296 | sin( $bearing ) * sin( $angularDistance ) * cos( $startingCoordinates['lat'] ), |
297 | | - cos( $angularDistance ) - sin( $startingCoordinates['lat'] ) * sin( $lat ) |
| 297 | + cos( $angularDistance ) - sin( $startingCoordinates['lat'] ) * sin( $lat ) ) |
298 | 298 | ) |
299 | 299 | ); |
300 | 300 | } |
Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php |
— | — | @@ -80,12 +80,16 @@ |
81 | 81 | $parsedCoords = MapsCoordinateParser::parseCoordinates( $parameters['location'] ); |
82 | 82 | |
83 | 83 | if ( $parsedCoords ) { |
84 | | - $output = MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['format'], $parameters['directional'] ) . |
85 | | - '<br />' . $manager->getErrorList(); |
| 84 | + $output = MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['format'], $parameters['directional'] ); |
86 | 85 | } else { |
87 | | - $output = htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ) . |
88 | | - '<br />' . $manager->getErrorList(); |
| 86 | + $output = htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ); |
89 | 87 | } |
| 88 | + |
| 89 | + $errorList = $manager->getErrorList(); |
| 90 | + |
| 91 | + if ( $errorList != '' ) { |
| 92 | + $output .= $errorList; |
| 93 | + } |
90 | 94 | } else { |
91 | 95 | $output = $manager->getErrorList(); |
92 | 96 | } |