diff options
| author | rsudev <rasch@munin-soft.de> | 2011-09-20 07:40:41 +0200 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2011-09-20 07:56:41 +0200 |
| commit | a2f2c5db407dd27d9c24cccb42dd45450f8c20af (patch) | |
| tree | e18186c3f2a48708b58abddc8894a63c9735bb6f /main/src/cgeo/geocaching/maps/google/GoogleOverlay.java | |
| parent | 617d43896cc074a8233e6fdb7f96568afd4f331a (diff) | |
| download | cgeo-a2f2c5db407dd27d9c24cccb42dd45450f8c20af.zip cgeo-a2f2c5db407dd27d9c24cccb42dd45450f8c20af.tar.gz cgeo-a2f2c5db407dd27d9c24cccb42dd45450f8c20af.tar.bz2 | |
Renamed map classes to uppercase
Diffstat (limited to 'main/src/cgeo/geocaching/maps/google/GoogleOverlay.java')
| -rw-r--r-- | main/src/cgeo/geocaching/maps/google/GoogleOverlay.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java b/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java new file mode 100644 index 0000000..03caafb --- /dev/null +++ b/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java @@ -0,0 +1,56 @@ +package cgeo.geocaching.maps.google; + +import cgeo.geocaching.cgSettings; +import cgeo.geocaching.maps.PositionOverlay; +import cgeo.geocaching.maps.ScaleOverlay; +import cgeo.geocaching.maps.interfaces.MapViewImpl; +import cgeo.geocaching.maps.interfaces.GeneralOverlay; +import cgeo.geocaching.maps.interfaces.OverlayImpl; + +import com.google.android.maps.MapView; +import com.google.android.maps.Overlay; + +import android.app.Activity; +import android.graphics.Canvas; + +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +public class GoogleOverlay extends Overlay implements OverlayImpl { + + private GeneralOverlay overlayBase = null; + private Lock lock = new ReentrantLock(); + + public GoogleOverlay(Activity activityIn, cgSettings settingsIn, overlayType ovlType) { + switch (ovlType) { + case PositionOverlay: + overlayBase = new PositionOverlay(settingsIn, activityIn, this); + break; + case ScaleOverlay: + overlayBase = new ScaleOverlay(activityIn, settingsIn, this); + } + } + + @Override + public void draw(Canvas canvas, MapView mapView, boolean shadow) { + super.draw(canvas, mapView, shadow); + + if (overlayBase != null) { + overlayBase.draw(canvas, (MapViewImpl) mapView, shadow); + } + } + + public GeneralOverlay getBase() { + return overlayBase; + } + + @Override + public void lock() { + lock.lock(); + } + + @Override + public void unlock() { + lock.unlock(); + } +} |
