Skip to content
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

Exception not handled correctly when changing to unknown projection #980

Closed
prushforth opened this issue Sep 13, 2024 · 0 comments
Closed
Labels

Comments

@prushforth
Copy link
Member

Steps to reproduce

Do a build
Load localhost dist/index.html
Copy base osm layer, paste, now have 2 layers
Open devtools, select <mapml-viewer> in elements panel
Change projection="OSMTILE" to projection="FOO"

What happens:

Exception:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'latLngToPoint')
at i.project (leaflet-src.js:4095:29)
at i.latLngToLayerPoint (leaflet-src.js:4117:31)
at i._getCenterOffset (leaflet-src.js:4643:17)
at i._tryAnimatedPan (leaflet-src.js:4718:23)
at i.setView (leaflet-src.js:3309:12)
at MapViewer.zoomTo (mapml-viewer.js:993:15)
at mapml-viewer.js:391:18

What should happen:

A user friendly error message should be console logged. (there is no Promise.catch on that block).

@prushforth prushforth added the bug label Sep 13, 2024
prushforth added a commit to prushforth/MapML.js that referenced this issue Sep 13, 2024
prushforth added a commit to prushforth/MapML.js that referenced this issue Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant