blob: 8473faae681cf5dc89212ed97316f834642dc39e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
package cgeo.geocaching.googlemaps;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import android.app.Activity;
import android.graphics.Canvas;
import cgeo.geocaching.cgSettings;
import cgeo.geocaching.mapcommon.cgMapMyOverlay;
import cgeo.geocaching.mapcommon.cgOverlayScale;
import cgeo.geocaching.mapinterfaces.MapViewImpl;
import cgeo.geocaching.mapinterfaces.OverlayBase;
import cgeo.geocaching.mapinterfaces.OverlayImpl;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
public class googleOverlay extends Overlay implements OverlayImpl {
private OverlayBase overlayBase = null;
private Lock lock = new ReentrantLock();
public googleOverlay(Activity activityIn, cgSettings settingsIn, overlayType ovlType) {
switch (ovlType) {
case PositionOverlay:
overlayBase = new cgMapMyOverlay(settingsIn, activityIn, this);
break;
case ScaleOverlay:
overlayBase = new cgOverlayScale(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 OverlayBase getBase() {
return overlayBase;
}
@Override
public void lock() {
lock.lock();
}
@Override
public void unlock() {
lock.unlock();
}
}
|