diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-09-03 15:48:32 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-09-12 13:59:11 +0200 |
commit | cb771f6aca2ef3cd0d1bf686139e18ce7cc0e233 (patch) | |
tree | 3256edac82653303fbafdf70fe8623e9598865de /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | |
parent | 5d000d090fd1d69fb902fd5b477d3bb996e3c955 (diff) | |
download | qtlocation-mapboxgl-cb771f6aca2ef3cd0d1bf686139e18ce7cc0e233.tar.gz |
[android] initialize LocationLayerPlugin with Map
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.java | 35 |
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 // |