Conversation
|
Could you describe what situation lead to this code path being called without We also have an assert a few lines up so it should be one or the other, the assert or this check. |
|
cc @Meekohi |
|
Yeah if there is some way for this to come up in practice we should address the root issue -- otherwise I was hoping the |
|
Well, it just broke aviamaps.com/map immediately when page loaded so 🤷♂️ |
|
@pakastin When I try a minimal test case it's working as expected, are you doing anything special? It would be helpful if you could work the error you're seeing down into a minimal test case, so we can work out what's causing this issue. |
|
Ok I found the cause. I was calling fitBounds before map load event. That fixed the problem. I would make a check though, since mapbox-gl-js/src/ui/control/geolocate_control.js Lines 363 to 372 in 7a4eb62 |
|
Oh I see at line mapbox-gl-js/src/ui/control/geolocate_control.js Lines 129 to 130 in 7a4eb62 checkGeolocationSupport is async so the zoom event is being registered and may be triggered before setupUI is run.
@pakastin or @Meekohi do you want to fix the root cause here? Should just be a matter of putting |
|
Yup I think I get the flow -- I'll try to tackle this tonight unless someone can get to it earlier. |
Fixes an issue when this._circleElement doesn't exist before trying to update it.