Maps4HTML / MapML.js

A custom <mapml-viewer> and <layer-> element suite
https://maps4html.org/MapML.js/
Other
56 stars 16 forks source link

Exception not handled correctly when changing to unknown projection #980

Closed prushforth closed 4 days ago

prushforth commented 5 days ago

Steps to reproduce

Do a build Load localhost dist/index.html Copy base osm layer, paste, now have 2 layers Open devtools, select \ 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).