Issue #6522 - Interpretation of eastern longitudes in google maps urls is wrong - fixed
This commit is contained in:
parent
3dff5cd7bb
commit
5348dffdae
2 changed files with 3 additions and 3 deletions
|
@ -646,9 +646,9 @@ public class GeoPointParserUtil {
|
|||
|
||||
private static double parseLon(String lonString) {
|
||||
if (lonString.startsWith("E")) {
|
||||
return -Double.valueOf(lonString.substring(1));
|
||||
} else if (lonString.startsWith("W")) {
|
||||
return Double.valueOf(lonString.substring(1));
|
||||
} else if (lonString.startsWith("W")) {
|
||||
return -Double.valueOf(lonString.substring(1));
|
||||
}
|
||||
return Double.valueOf(lonString);
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ public class GeoPointParserUtilTest {
|
|||
url = "http://maps.google.com/maps?q=N" + dlat + ",E" + Math.abs(dlon);
|
||||
System.out.println("url: " + url);
|
||||
actual = GeoPointParserUtil.parse(url);
|
||||
assertGeoPoint(actual, new GeoParsedPoint(dlat, -Math.abs(dlon)));
|
||||
assertGeoPoint(actual, new GeoParsedPoint(dlat, Math.abs(dlon)));
|
||||
|
||||
url = "http://maps.google.com/maps?f=d&saddr=" + dlat +"," +dlon +"&daddr=" +dlat +"," +dlon+"&hl=en";
|
||||
System.out.println("url: " + url);
|
||||
|
|
Loading…
Reference in a new issue