diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-12-13 12:40:40 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-12-13 17:44:54 +0100 |
commit | 1d410c94fc6bd6d9f4880f22193328403302a847 (patch) | |
tree | c71117d40f0e2f3722d64e019f06d0b23e425c1f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java | |
parent | 3fbd9578c7bc016b0599d1df5d12125f325b9cda (diff) | |
download | qtlocation-mapboxgl-1d410c94fc6bd6d9f4880f22193328403302a847.tar.gz |
[android] register compass sensor listener only if provided data is consumed by the location layer or location camera
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java index b67ce3da88..73ecf44d41 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java @@ -11,8 +11,8 @@ import com.google.gson.JsonObject; import com.mapbox.geojson.Feature; import com.mapbox.geojson.Point; import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.location.modes.RenderMode; +import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.style.layers.Layer; import com.mapbox.mapboxsdk.style.layers.SymbolLayer; @@ -196,6 +196,10 @@ final class LocationLayerController implements MapboxAnimator.OnLayerAnimationsV return isHidden; } + boolean isConsumingCompass() { + return renderMode == RenderMode.COMPASS; + } + private void setLayerVisibility(@NonNull String layerId, boolean visible) { Layer layer = style.getLayer(layerId); if (layer != null) { |