Mapbox-gl-js: Invalid LngLat object with valid data.

Created on 1 Sep 2016  路  5Comments  路  Source: mapbox/mapbox-gl-js

When creating some LngLat objects, i will get this issue where this.lat is null, but as you can see in the screen shot, they should not be null, as the data is being passed in correctly.

This is ultimately giving me a:

transform.js:469 Uncaught Error: failed to invert matrix

when trying to fitBounds() on the map.

screen shot 2016-09-01 at 3 51 30 pm

Thanks,

Dan

Most helpful comment

As mentioned in the CHANGELOG, as of 0.23.0, the LatLngBounds constructor obeys its documented argument order (southwest, northeast), in order to allow bounds across the dateline #2414. You need to ensure that the coordinates you pass to it are actually a southwest and northeast corner, or use LatLngBounds#extend to build a containing hull.

All 5 comments

Can you please provide a self-contained JSFiddle that demonstrates the issue?

I am trying to fitBounds and cant seem to get past this error anywhere:

transform.js:469Uncaught Error: failed to invert matrix

https://gist.github.com/eatpurely/d7e8cd8e76695472d87d828fc60645a4

As mentioned in the CHANGELOG, as of 0.23.0, the LatLngBounds constructor obeys its documented argument order (southwest, northeast), in order to allow bounds across the dateline #2414. You need to ensure that the coordinates you pass to it are actually a southwest and northeast corner, or use LatLngBounds#extend to build a containing hull.

@jfirebaugh can you please give an example of how to solve this problem with extend().

Thanks in advance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rasagy picture rasagy  路  3Comments

mollymerp picture mollymerp  路  3Comments

stevage picture stevage  路  3Comments

aaronlidman picture aaronlidman  路  3Comments

rigoneri picture rigoneri  路  3Comments