Index: trunk/extensions/Maps/RELEASE-NOTES |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | (trunk) |
13 | 13 | |
14 | 14 | * Fixed display of attribution control for OpenLayers. |
| 15 | +* Fixed to big precision of geographic coordinates in decimal minutes format (bug 32407). |
15 | 16 | |
16 | 17 | === Maps 1.0.4 === |
17 | 18 | (2011-10-15) |
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php |
— | — | @@ -284,13 +284,15 @@ |
285 | 285 | case Maps_COORDS_DD: |
286 | 286 | return $coordinate . self::SYMBOL_DEG; |
287 | 287 | case Maps_COORDS_DM: |
288 | | - $isNegative = $coordinate < 0; |
289 | 288 | $coordinate = abs( $coordinate ); |
| 289 | + $degrees = floor( $coordinate ); |
290 | 290 | |
291 | | - $result = floor( $coordinate ) . self::SYMBOL_DEG . ' ' . ( $coordinate - floor( $coordinate ) ) * 60 . self::SYMBOL_MIN; |
292 | | - if ( $isNegative ) $result = '-' . $result; |
293 | | - |
294 | | - return $result; |
| 291 | + return sprintf( |
| 292 | + "%s%d%s %0.3f%s", |
| 293 | + $coordinate < 0 ? '-' : '', |
| 294 | + $degrees, self::SYMBOL_DEG, |
| 295 | + ( $coordinate - $degrees ) * 60, self::SYMBOL_MIN |
| 296 | + ); |
295 | 297 | default: |
296 | 298 | throw new Exception( __METHOD__ . " does not support formatting of coordinates to the $targetFormat notation." ); |
297 | 299 | } |