Index: trunk/extensions/Maps/Maps_CoordinateParser.php |
— | — | @@ -405,6 +405,8 @@ |
406 | 406 | * FIXME: fix innacuracy |
407 | 407 | */ |
408 | 408 | private static function parseDMSCoordinate( $coordinate ) { |
| 409 | + $coordinate = str_replace( ' ', '', $coordinate ); |
| 410 | + |
409 | 411 | $isNegative = substr( $coordinate, 0, 1 ) == '-'; |
410 | 412 | if ( $isNegative ) $coordinate = substr( $coordinate, 1 ); |
411 | 413 | |
— | — | @@ -412,11 +414,13 @@ |
413 | 415 | $minutePosition = strpos( $coordinate, Maps_GEO_MIN ); |
414 | 416 | $secondPosition = strpos( $coordinate, Maps_GEO_SEC ); |
415 | 417 | |
416 | | - $minuteLength = $minutePosition - $degreePosition - 1; |
| 418 | + $degSignLength = strlen( Maps_GEO_DEG ); |
| 419 | + |
| 420 | + $minuteLength = $minutePosition - $degreePosition - $degSignLength; |
417 | 421 | $secondLength = $secondPosition - $minutePosition - 1; |
418 | 422 | |
419 | 423 | $degrees = substr ( $coordinate, 0, $degreePosition ); |
420 | | - $minutes = substr ( $coordinate, $degreePosition + 1, $minuteLength ); |
| 424 | + $minutes = substr ( $coordinate, $degreePosition + $degSignLength, $minuteLength ); |
421 | 425 | $seconds = substr ( $coordinate, $minutePosition + 1, $secondLength ); |
422 | 426 | |
423 | 427 | $coordinate = $degrees + ( $minutes + $seconds / 60 ) / 60; |