Draggable Init Error w/ Infinite CRS and worldCopyJump true
I was using Proj4Leaflet to create custom CRS's and accidentally discovered that the Draggable's onZoomEnd handler doesn't account for the fact that map.getPixelWorldBounds() can return null when the crs.getProjectedBounds() returns null. That happens if it has the infinite flag returning true. This cascades to a null reference error during loading when this._map.getPixelWorldBounds().getSize().x blows up.
Note that you have to set worldCopyJump to true in order to actually have the onZoomEnd handler get wired up! In the fiddle, if you turn it off you don't get the error.
I'll let someone who knows more about how Draggable works think about how to handle the infinite case....
Steps to reproduce Steps to reproduce the behavior:
- Create a CRS object that sets infinite to true.
- Apply it to the map options on initialization and set worldCopyJump to true so that the onZoomEnd handler is attached.
- Run it.
Expected behavior No errors.
Current behavior Null reference error.
Environment
- Leaflet version: 1.7.1
- Browser (with version): Chrome 87.0.4280.88 | Firefox 78.4.1esr
- OS/Platform (with version): Windows 10 | Amazon Linux 2
Minimal example reproducing the issue I've created a contrived case to demonstrate the issue here. It's not how I stumbled on it originally, but it demonstrates the error. https://jsfiddle.net/fv0k9o1w/