Closed VincentJoshuaET closed 2 years ago
Just tried in iOS: does not crash, so only a problem on Android.
I don't know why this happens, because on other Mapbox styles I never have this issue.
@VincentJoshuaET Could you let us know how are you using locationComponent and which style are you referring to ? we have an example that uses same code here for reference.
I use it the same way as your reference but without changing the puck.
Can we link here our own customized style not from Mapbox?
I tried many of our own styles and this did not ever happen before. Also the above style is still working for iOS, so the problem is only on Android, and I can confirm my code is working for all other styles I tried.
I was able to fix it by avoiding adding a source with an empty id. It’s because the location puck layer also uses a source with an empty id.
Maybe you should instead use a source with an arbitrary string ID? So this will not happen to others.
@VincentJoshuaET Thank you for this suggestion, will pass it along to the team.
Also ran into this error printout. Changing the source or layer id did not resolve. Moving
mapView.location.updateSettings {
enabled = true
pulsingEnabled = true
}
to be after addSource
and addLayer
calls resolved the issue.
Environment
Observed behavior and steps to reproduce
This works for all our other styles except for one.
binding.mapView.location.updateSettings { enabled = true }
This code will make the app crash with the below error.
Do we need to change anything in the Mapbox style to avoid this?