You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In using proj4leaflet with more recent version of proj4js (and Leaflet), we noticed that in unprojecting coordinates that return one or both lat and lon as NaN, these values are passed unfiltered. directly to the L.LatLng() constructor here, which throws.
The question is, if we were to deal with this situation in the code, would it be as simple as mapping NaN to 0 (as was done in earlier versions of proj4js), or would some other path be advisable. Clearly returning NaN seems like the right thing to do for proj4js, but I guess how to handle that depends on the situation in Leaflet.
Any thoughts on this?
The text was updated successfully, but these errors were encountered:
I am also facing the same issue. I'm using proj4leaflet with gall peters projection in react leaflet. Getting this error:
Uncaught Error: Invalid LatLng object: (NaN, 85.20100026824394)
at new LatLng (LatLng.js:32)
at NewClass.unproject (proj4leaflet.js:46)
at NewClass.pointToLatLng (CRS.js:41)
at NewClass.unproject (Map.js:1000)
at NewClass.layerPointToLatLng (Map.js:1008)
at NewClass._fireDOMEvent (Map.js:1436)
at NewClass._handleDOMEvent (Map.js:1397)
at HTMLDivElement.handler (DomEvent.js:92)
In using proj4leaflet with more recent version of proj4js (and Leaflet), we noticed that in unprojecting coordinates that return one or both lat and lon as
NaN
, these values are passed unfiltered. directly to theL.LatLng()
constructor here, which throws.The question is, if we were to deal with this situation in the code, would it be as simple as mapping
NaN
to 0 (as was done in earlier versions of proj4js), or would some other path be advisable. Clearly returningNaN
seems like the right thing to do for proj4js, but I guess how to handle that depends on the situation in Leaflet.Any thoughts on this?
The text was updated successfully, but these errors were encountered: