aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleMapView.java6
-rw-r--r--main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java3
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java6
3 files changed, 15 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
index deebcce..8bf7deb 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
@@ -3,6 +3,7 @@ package cgeo.geocaching.maps.google;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import cgeo.geocaching.Settings;
+import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.maps.CachesOverlay;
import cgeo.geocaching.maps.OtherCachersOverlay;
import cgeo.geocaching.maps.PositionOverlay;
@@ -90,6 +91,11 @@ public class GoogleMapView extends MapView implements MapViewImpl {
}
@Override
+ public Viewport getViewport() {
+ return new Viewport(getMapViewCenter(), getLatitudeSpan() / 1e6, getLongitudeSpan() / 1e6);
+ }
+
+ @Override
public void addOverlay(OverlayImpl ovl) {
getOverlays().add((Overlay) ovl);
}
diff --git a/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java b/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
index 08e04f1..c567cf2 100644
--- a/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
+++ b/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.maps.interfaces;
+import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.maps.CachesOverlay;
import cgeo.geocaching.maps.OtherCachersOverlay;
import cgeo.geocaching.maps.PositionOverlay;
@@ -78,4 +79,6 @@ public interface MapViewImpl {
*/
boolean needsInvertedColors();
+ Viewport getViewport();
+
}
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
index 048f7a2..aaede4d 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
@@ -2,6 +2,7 @@ package cgeo.geocaching.maps.mapsforge;
import cgeo.geocaching.R;
import cgeo.geocaching.Settings;
+import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.maps.CachesOverlay;
import cgeo.geocaching.maps.OtherCachersOverlay;
import cgeo.geocaching.maps.PositionOverlay;
@@ -71,6 +72,11 @@ public class MapsforgeMapView extends MapView implements MapViewImpl {
}
@Override
+ public Viewport getViewport() {
+ return new Viewport(getMapViewCenter(), getLatitudeSpan() / 1e6, getLongitudeSpan() / 1e6);
+ }
+
+ @Override
public void addOverlay(OverlayImpl ovl) {
getOverlays().add((Overlay) ovl);
}