aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java')
-rwxr-xr-xmain/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java b/main/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java
new file mode 100755
index 0000000..281a6e9
--- /dev/null
+++ b/main/src/cgeo/geocaching/maps/google/v1/GoogleDistanceOverlay.java
@@ -0,0 +1,53 @@
+package cgeo.geocaching.maps.google.v1;
+
+import cgeo.geocaching.location.Geopoint;
+import cgeo.geocaching.maps.DistanceOverlay;
+import cgeo.geocaching.maps.interfaces.GeneralOverlay;
+import cgeo.geocaching.maps.interfaces.MapViewImpl;
+import cgeo.geocaching.maps.interfaces.OverlayImpl;
+
+import com.google.android.maps.MapView;
+import com.google.android.maps.Overlay;
+
+import android.graphics.Canvas;
+
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class GoogleDistanceOverlay extends Overlay implements OverlayImpl {
+
+ private final DistanceOverlay overlayBase;
+ private final Lock lock = new ReentrantLock();
+
+ public GoogleDistanceOverlay(final MapViewImpl mapView, final Geopoint coords, final String geocode) {
+ overlayBase = new DistanceOverlay(this, mapView, coords, geocode);
+ }
+
+ @Override
+ public void draw(final Canvas canvas, final MapView mapView, final boolean shadow) {
+ super.draw(canvas, mapView, shadow);
+
+ assert mapView instanceof MapViewImpl;
+ overlayBase.draw(canvas, (MapViewImpl) mapView, shadow);
+ }
+
+ public GeneralOverlay getBase() {
+ return overlayBase;
+ }
+
+ @Override
+ public void lock() {
+ lock.lock();
+ }
+
+ @Override
+ public void unlock() {
+ lock.unlock();
+ }
+
+ @Override
+ public MapViewImpl getMapViewImpl() {
+ throw new UnsupportedOperationException();
+ }
+
+}