summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/CameraMode.java66
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/RenderMode.java45
2 files changed, 111 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/CameraMode.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/CameraMode.java
new file mode 100644
index 0000000000..5edffd00bd
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/CameraMode.java
@@ -0,0 +1,66 @@
+package com.mapbox.mapboxsdk.plugins.locationlayer.modes;
+
+import android.location.Location;
+import android.support.annotation.IntDef;
+
+import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Contains the variety of camera modes which determine how the camera will track
+ * the user location.
+ */
+public final class CameraMode {
+
+ private CameraMode() {
+ // Class should not be initialized
+ }
+
+ /**
+ * Determine the camera tracking behavior in the {@link LocationLayerPlugin}.
+ */
+ @IntDef( {NONE, NONE_COMPASS, NONE_GPS, TRACKING, TRACKING_COMPASS, TRACKING_GPS, TRACKING_GPS_NORTH})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Mode {
+ }
+
+ /**
+ * No camera tracking.
+ */
+ public static final int NONE = 0x00000008;
+
+ /**
+ * Camera does not track location, but does track compass bearing.
+ */
+ public static final int NONE_COMPASS = 0x00000010;
+
+ /**
+ * Camera does not track location, but does track GPS {@link Location} bearing.
+ */
+ public static final int NONE_GPS = 0x00000016;
+
+ /**
+ * Camera tracks the user location.
+ */
+ public static final int TRACKING = 0x00000018;
+
+ /**
+ * Camera tracks the user location, with bearing
+ * provided by a compass.
+ */
+ public static final int TRACKING_COMPASS = 0x00000020;
+
+ /**
+ * Camera tracks the user location, with bearing
+ * provided by a normalized {@link Location#getBearing()}.
+ */
+ public static final int TRACKING_GPS = 0x00000022;
+
+ /**
+ * Camera tracks the user location, with bearing
+ * always set to north (0).
+ */
+ public static final int TRACKING_GPS_NORTH = 0x00000024;
+}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/RenderMode.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/RenderMode.java
new file mode 100644
index 0000000000..88db25beb7
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/modes/RenderMode.java
@@ -0,0 +1,45 @@
+package com.mapbox.mapboxsdk.plugins.locationlayer.modes;
+
+import android.support.annotation.IntDef;
+
+import com.mapbox.mapboxsdk.plugins.locationlayer.CompassEngine;
+import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Contains the variety of ways the user location can be rendered on the map.
+ */
+public final class RenderMode {
+
+ private RenderMode() {
+ // Class should not be initialized
+ }
+
+ /**
+ * One of these constants should be used with {@link LocationLayerPlugin#setRenderMode(int)}.
+ * mode can be switched at anytime by calling the {@code setLocationLayerMode} method passing
+ * in the new mode you'd like the location layer to be in.
+ */
+ @IntDef( {COMPASS, GPS, NORMAL})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Mode {
+ }
+
+ /**
+ * Basic tracking is enabled, bearing ignored.
+ */
+ public static final int NORMAL = 0x00000012;
+
+ /**
+ * Tracking the user location with bearing considered
+ * from a {@link CompassEngine}.
+ */
+ public static final int COMPASS = 0x00000004;
+
+ /**
+ * Tracking the user location with bearing considered from {@link android.location.Location}.
+ */
+ public static final int GPS = 0x00000008;
+}