Post 1.6.0, fitBounds method returns a NaN zoom value
This seems to possibly coincide with the MapboxGL 0.24 upgrade. Using fitBounds, and applying the returned values on to map props would cause the map component to fail.
Having a similar issue here, did you ever get to the bottom of this?
Appears tr.scaleZoom(tr.scale * Math.min(scaleX, scaleY)); being passed tr.scale = 1, scaleX = 35.78821257289714, scaleY = -36.83207022162391
I'm guessing because it's taking the negative point from the min() call before going to tr.scaleZoom(), but I've a limited understanding here of why exactly since the returned lat/long coord is correct, just the zoom that is wrong.
This seems to be due to passing a negative value to the scaleZoom method in some cases. If the line is changed to const zoom = tr.scaleZoom(tr.scale * Math.abs(Math.min(scaleX, scaleY))); it works as expected again.
Hey guys. Were you able to come up with a solution for this - if so, can you drop a PR?
Yeah I could probably do so. The fix relies on ensuring that the scale passed to the scaleZoom method is not negative. The line I posted above fixes the issue.
Resolved by #159.