summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
index 08369bb566..8892aa45fe 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
@@ -43,6 +43,7 @@ import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import com.mapbox.mapboxsdk.log.Logger;
+import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin;
import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.light.Light;
@@ -75,6 +76,7 @@ public final class MapboxMap {
private final OnGesturesManagerInteractionListener onGesturesManagerInteractionListener;
+ private LocationLayerPlugin locationLayerPlugin;
private MapboxMap.OnFpsChangedListener onFpsChangedListener;
MapboxMap(NativeMapView map, Transform transform, UiSettings ui, Projection projection,
@@ -110,12 +112,14 @@ public final class MapboxMap {
// if user hasn't loaded a Style yet
nativeMapView.setStyleUrl(Style.MAPBOX_STREETS);
}
+ locationLayerPlugin.onStart();
}
/**
* Called when the hosting Activity/Fragment onStop() method is called.
*/
void onStop() {
+ locationLayerPlugin.onStop();
}
/**
@@ -175,6 +179,20 @@ public final class MapboxMap {
}
/**
+ * Called when the map will start loading style.
+ */
+ void onStartLoadingMap() {
+ locationLayerPlugin.onStartLoadingMap();
+ }
+
+ /**
+ * Called the map finished loading style.
+ */
+ void onFinishLoadingStyle() {
+ locationLayerPlugin.onFinishLoadingStyle();
+ }
+
+ /**
* Called when the region is changing or has changed.
*/
void onUpdateRegionChange() {
@@ -2284,6 +2302,23 @@ public final class MapboxMap {
}
//
+ // LocationLayerPlugin
+ //
+
+ void injectLocationLayerPlugin(LocationLayerPlugin locationLayerPlugin) {
+ this.locationLayerPlugin = locationLayerPlugin;
+ }
+
+ /**
+ * Returns an object that can be used to display user's location on the Map.
+ * @return the location layer
+ */
+ @NonNull
+ public LocationLayerPlugin getLocationLayerPlugin() {
+ return locationLayerPlugin;
+ }
+
+ //
// Interfaces
//