CanvasSource.load() doesn't catch/re-fire errors, unlike ImageSource.load()
Author: SylvSylvCreated Sep 14, 2026Updated Sep 14, 2026
Labelsbugenhancementgood first issuePR is more than welcomed
When using image source providing NOK coordinates, a map.error is triggered, and the client UI can handle it. It is not the case for canvas source.
Steps to Trigger Behavior
- AddSource with a canvas source and out-of-range coordinates (or call setCoordinates with invalid lng/lat after add)
Expected Behavior
map.on('error', ...) fires, same as the equivalent image source case
Actual Behavior
nothing fires on map; the browser logs an unhandled promise rejection instead
Thank you for your time.
Source: maplibre/maplibre-gl-js