-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fitBounds randomly throw failed to invert matrix #3474
Comments
Hi Nicholas, Thanks for reporting this issue! Could you pull together a jsfiddle that shows the issue, or provide a complete code snippet of your integration code? And specify what browsers this issue appears on? Thanks,
|
Hi Tom, This is happening on Safari Version 10.0 (11602.1.50.0.10) and Chrome (54.0.2840.71). Regarding a jsfiddle that show the issue, I'm afraid I can't or not easily. This is more or less random and only happens on some specific conditions. That said I'll try to get back to this and pull together a jsfiddle. But it would really help me build will to do that 🙏🏽, if somebody can confirm that the following is expected for latY(). Because even with my very limited comprehension, this doesn't look right: let lat = -90
expect(latY(lat)).to.be(-Infinity) |
@nrako next time this is triggered, can you extract the call trace (the chain of function calls that lead to |
@mourner thanks for your help, I wish I could isolate the root cause I'm think I'm doing something wrong but can't pint point what. The bundle is built with mapbox-gl 0.21.0 but I have the same issue in 0.25.1.
toLngLat = {"lng":4.394181233333313,"lat":44.01333223374033}
fromPoint = {"x":3259230.626962026,"y":-5406962.913019736}
toPoint = {"x":206.5,"y":366}
fromPoint = {"x":3259230.626962026,"y":-5406962.913019736} options = {"offset":[0,-33.5],"duration":500,"padding":41.3,"maxZoom":null,"linear":true,"center":{"lng":4.394181233333313,"lat":44.01333223374033},"zoom":5.6954682781259205,"bearing":0}" |
That's very helpful, thanks! I wonder if doing |
That do help! Did that change and got a breakpoint on
|
Getting this issue if
|
Same problem, I was using geolocation API to get geolocation of my laptop on two separate Chrome windows running same code. In most cases they return same geo coordinates (not surprising) and that throws an error when I try to extend bounds and then use
|
@elishaterada @prasanna-kumar what you're describing is a duplicate of #3307 |
This might bee an other error but the end result is the same. I modified the jsFiddle a bit so you can reproduce: https://jsfiddle.net/4ztjmtoj/15/ I have added a zoom in and a zoom out button to help trigger the bugg. We have also noticed that the map moves to the south pole when this happens. If you drag the map it start working again. An you can then zoom inn and out again. |
@ArntB the JSFiddle is using v0.21.0. Can you try the master version? |
Updated with v0.26.0 https://jsfiddle.net/4ztjmtoj/16/ |
Do you have a cdn link to the master build? |
I am having the same issue. |
The fix is in the 0.27 release now. |
@keyofj do you have the map's |
@santinogue any chance you could create a simple jsfiddle example that demonstrates this? I haven't managed to reproduce it on the examples previously shared on this ticket. |
@anandthakker I tried in a jsfiddle (https://jsfiddle.net/snoguera/hqp1zceL/1/) but couldn't reproduce the error. I don't know which other actors are in play here , only calling fit bounds and zoom in/out doesn't seem to be the way to trigger the issue in that map, it does in my local environment. |
If it helps, I also get the same error on random occasions when making zoom in/out. First is raised a
Seems that the problem in this last error is when trying to convert the point to coordinate, in the line Details of
The line:
Question, what about if |
Encountered on versions 0.21.0 && 0.25.1
Sorry about the "randomly issue", hard to reproduce, and I believe it's a size / timing issue. Which is also why I got fed-up with trying to debug it and just have hanging breakpoints waiting for next occurrences.
I'm sharing my finding hoping someone can help pin-point the root issue.
Transform.latY(lat, worldSize)
Sometimes receive alat
of-90
and then returnInfinity
. (Is that expected???)This results is then used (through
this.y
) to calculate the matrices:https://github.com/mapbox/mapbox-gl-js/blob/master/js/geo/transform.js#L455
Resulting in
NaN
which end up raising thefailed to invert matrix
https://github.com/mapbox/mapbox-gl-js/blob/master/js/geo/transform.js#L467I don't yet understand why
latY()
randomly receiveslat: -90
, but this all start withfitBounds
with options:linear: true
, a padding and offset.The text was updated successfully, but these errors were encountered: