aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps/google
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/maps/google')
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleMapActivity.java7
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleMapProvider.java14
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleOverlay.java3
3 files changed, 16 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapActivity.java b/main/src/cgeo/geocaching/maps/google/GoogleMapActivity.java
index 0377fe9..5649d19 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleMapActivity.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleMapActivity.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.maps.google;
+import cgeo.geocaching.activity.FilteredActivity;
import cgeo.geocaching.maps.AbstractMap;
import cgeo.geocaching.maps.CGeoMap;
import cgeo.geocaching.maps.interfaces.MapActivityImpl;
@@ -12,7 +13,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
-public class GoogleMapActivity extends MapActivity implements MapActivityImpl {
+public class GoogleMapActivity extends MapActivity implements MapActivityImpl, FilteredActivity {
private AbstractMap mapBase;
@@ -127,4 +128,8 @@ public class GoogleMapActivity extends MapActivity implements MapActivityImpl {
mapBase.goManual(view);
}
+ @Override
+ public void showFilterMenu(View view) {
+ // do nothing, the filter bar only shows the global filter
+ }
}
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapProvider.java b/main/src/cgeo/geocaching/maps/google/GoogleMapProvider.java
index 6973338..1fa38ad 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleMapProvider.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleMapProvider.java
@@ -16,7 +16,6 @@ public final class GoogleMapProvider extends AbstractMapProvider {
public static final String GOOGLE_MAP_ID = "GOOGLE_MAP";
public static final String GOOGLE_SATELLITE_ID = "GOOGLE_SATELLITE";
- private static GoogleMapProvider instance;
private final MapItemFactory mapItemFactory;
@@ -29,15 +28,16 @@ public final class GoogleMapProvider extends AbstractMapProvider {
mapItemFactory = new GoogleMapItemFactory();
}
+ private static class Holder {
+ private static final GoogleMapProvider INSTANCE = new GoogleMapProvider();
+ }
+
public static GoogleMapProvider getInstance() {
- if (instance == null) {
- instance = new GoogleMapProvider();
- }
- return instance;
+ return Holder.INSTANCE;
}
public static boolean isSatelliteSource(final MapSource mapSource) {
- return mapSource != null && mapSource instanceof GoogleSatelliteSource;
+ return mapSource instanceof GoogleSatelliteSource;
}
@Override
@@ -67,7 +67,7 @@ public final class GoogleMapProvider extends AbstractMapProvider {
private static abstract class AbstractGoogleMapSource extends AbstractMapSource {
- public AbstractGoogleMapSource(final String id, final MapProvider mapProvider, final String name) {
+ protected AbstractGoogleMapSource(final String id, final MapProvider mapProvider, final String name) {
super(id, mapProvider, name);
}
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java b/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java
index d86eafe..773f9ff 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleOverlay.java
@@ -27,6 +27,9 @@ public class GoogleOverlay extends Overlay implements OverlayImpl {
break;
case ScaleOverlay:
overlayBase = new ScaleOverlay(activityIn, this);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}