-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed LocationTracking issue delayed permissions #958
fixed LocationTracking issue delayed permissions #958
Conversation
8fdb5e3
to
bd28c48
Compare
Does this resolve?
|
unlikely - when do you get this error? |
@felix-ht Seems to happen if I decline location permissions. |
@AAverin this is quite strange as the locationComponent should be null if there are no permissions. |
try this diff @AAverin diff --git a/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java b/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
index 4a352bc..96a9fe4 100644
--- a/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
+++ b/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
@@ -281,8 +281,8 @@ final class MapboxMapController
}
}
- private void updateLocationLocationComponentLayer() {
- if (locationComponent != null && style != null) {
+ private void updateLocationComponentLayer() {
+ if (locationComponent != null && style != null && hasLocationPermission()) {
locationComponent.applyStyle(buildLocationComponentOptions(style));
}
}
@@ -822,7 +822,7 @@ final class MapboxMapController
properties,
enableInteraction,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
@@ -848,7 +848,7 @@ final class MapboxMapController
properties,
enableInteraction,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
@@ -874,7 +874,7 @@ final class MapboxMapController
properties,
enableInteraction,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
@@ -900,7 +900,7 @@ final class MapboxMapController
properties,
enableInteraction,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
@@ -922,7 +922,7 @@ final class MapboxMapController
belowLayerId,
properties,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
@@ -944,7 +944,7 @@ final class MapboxMapController
belowLayerId,
properties,
null);
- updateLocationLocationComponentLayer();
+ updateLocationComponentLayer();
result.success(null);
break;
|
I have now updated to latest master and issue is still there: #968 |
…box-gl#958)" This reverts commit 17a701f.
On android if the users starts up the app for the first time it has no permissions to track the user location. Even if the the location tracking mode is later changed the location puck would not show because the locationComponent does not come up.
This PR fixes that by activating the locationComponent on a mode change if it hasn’t already been activated.