diff options
| -rw-r--r-- | main/src/cgeo/geocaching/cgeocaches.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/cgeocoords.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCBase.java | 7 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/geopoint/Geopoint.java | 13 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/geopoint/Viewport.java | 5 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/geopoint/GeopointTest.java | 6 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java | 2 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/mock/GC2CJPF.java | 2 |
8 files changed, 7 insertions, 32 deletions
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java index 09c0f5a..7d165b3 100644 --- a/main/src/cgeo/geocaching/cgeocaches.java +++ b/main/src/cgeo/geocaching/cgeocaches.java @@ -505,7 +505,7 @@ public class cgeocaches extends AbstractListActivity { if (Intent.ACTION_VIEW.equals(getIntent().getAction())) { type = CacheListType.OFFLINE; if (coords == null) { - coords = new Geopoint(0, 0); + coords = new Geopoint(0.0, 0.0); } } diff --git a/main/src/cgeo/geocaching/cgeocoords.java b/main/src/cgeo/geocaching/cgeocoords.java index b4868ce..fdedfda 100644 --- a/main/src/cgeo/geocaching/cgeocoords.java +++ b/main/src/cgeo/geocaching/cgeocoords.java @@ -419,7 +419,7 @@ public class cgeocoords extends Dialog { if (geo != null && geo.coordsNow != null) { gp = geo.coordsNow; } else { - gp = new Geopoint(0, 0); + gp = new Geopoint(0.0, 0.0); } } } diff --git a/main/src/cgeo/geocaching/connector/gc/GCBase.java b/main/src/cgeo/geocaching/connector/gc/GCBase.java index 91d3274..2f79fab 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCBase.java +++ b/main/src/cgeo/geocaching/connector/gc/GCBase.java @@ -194,12 +194,7 @@ public class GCBase { if (search != null) { List<Number> bounds = cgeoapplication.getInstance().getBounds(search.getGeocodes()); - int minLat = (int) ((Double) bounds.get(1) * 1e6); - int maxLat = (int) ((Double) bounds.get(2) * 1e6); - int maxLon = (int) ((Double) bounds.get(3) * 1e6); - int minLon = (int) ((Double) bounds.get(4) * 1e6); - - lastSearchViewport = new Viewport(minLat, maxLat, minLon, maxLon); + lastSearchViewport = new Viewport(bounds.get(1).doubleValue(), bounds.get(2).doubleValue(), bounds.get(4).doubleValue(), bounds.get(3).doubleValue()); searchResult.addGeocodes(search.getGeocodes()); } } diff --git a/main/src/cgeo/geocaching/geopoint/Geopoint.java b/main/src/cgeo/geocaching/geopoint/Geopoint.java index 965a346..a672a6e 100644 --- a/main/src/cgeo/geocaching/geopoint/Geopoint.java +++ b/main/src/cgeo/geocaching/geopoint/Geopoint.java @@ -47,19 +47,6 @@ public final class Geopoint implements ICoordinates { } /** - * Creates new Geopoint with given latitude and longitude (both microdegree). - * - * @param lat - * latitude - * @param lon - * longitude - */ - public Geopoint(final int lat, final int lon) - { - this(lat / 1e6, lon / 1e6); - } - - /** * Creates new Geopoint with latitude and longitude parsed from string. * * @param text diff --git a/main/src/cgeo/geocaching/geopoint/Viewport.java b/main/src/cgeo/geocaching/geopoint/Viewport.java index 0937b6d..8fe2ea6 100644 --- a/main/src/cgeo/geocaching/geopoint/Viewport.java +++ b/main/src/cgeo/geocaching/geopoint/Viewport.java @@ -27,9 +27,8 @@ public class Viewport { topRight = new Geopoint(centerLat + Math.abs(latSpan) / 2, centerLon + Math.abs(lonSpan) / 2); } - public Viewport(final int minLat, final int maxLat, final int minLon, final int maxLon) { - this(new Geopoint(Math.min(minLat, maxLat), Math.min(minLon, maxLon)), - new Geopoint(Math.max(minLat, maxLat), Math.max(minLon, maxLon))); + public Viewport(final double lat1, final double lat2, final double lon1, final double lon2) { + this(new Geopoint(lat1, lon1), new Geopoint(lat2, lon2)); } public double getLatitudeMin() { diff --git a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java index ba88992..7ce39b7 100644 --- a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java +++ b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java @@ -41,12 +41,6 @@ public class GeopointTest extends AndroidTestCase { Assert.assertFalse(gp1.equals(gp2)); } - public static void testCreateE6() { - final Geopoint gp1 = new Geopoint(48.2, 2.34); - final Geopoint gp2 = new Geopoint(48200000, 2340000); - Assert.assertTrue(gp1.isEqualTo(gp2, 1e-6)); - } - public static void testGetE6() { final Geopoint gp = new Geopoint(41.2, -3.4); Assert.assertEquals(41200000.0, gp.getLatitudeE6(), 1e-6); diff --git a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java index bf4d0cf..d19e504 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java +++ b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java @@ -17,7 +17,7 @@ import java.util.Map; public class GC1ZXX2 extends MockedCache { public GC1ZXX2() { - super(new Geopoint(52373217, 9710800)); + super(new Geopoint(52.373217, 9.710800)); } @Override diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java index b97d2bc..59f232b 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java +++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java @@ -18,7 +18,7 @@ import java.util.Map; public class GC2CJPF extends MockedCache { public GC2CJPF() { - super(new Geopoint(52425067, 9664200)); + super(new Geopoint(52.425067, 9.664200)); } @Override |
