Skip to content

Exception not handled correctly when changing to unknown projection #980

@prushforth

Description

@prushforth

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions