Open Kai-W opened 8 months ago
I was experimenting with relative URLs in styles and transforming all relative URLs to absoulte ones with the transformRequst Method. Unfortunatly the loading of Sprites failes with an invalid URL Error (because its relative) before the transformRequest Method gets called. https://github.com/maplibre/maplibre-gl-js/blob/f6035db6670de1af2d294e3cb5f6702f8616b53f/src/style/load_sprite.ts#L31C54-L31C70
maplibre-gl-js version: 4.1.1
browser: Chrome Version 123.0.6312.59
https://jsbin.com/ranucez/edit?html,console,output
transformRequest should be called bevor any checks if the URL is valid, eg a relative one
Error: Unable to parse URL "/maps/streets/sprite" and transformRequest never gets called for Sprites
Feel free to submit a PR with a fix.
Can you maybe share the transform request method for the relative urls? I think the following issue describes a similar issue:
I was experimenting with relative URLs in styles and transforming all relative URLs to absoulte ones with the transformRequst Method. Unfortunatly the loading of Sprites failes with an invalid URL Error (because its relative) before the transformRequest Method gets called. https://github.com/maplibre/maplibre-gl-js/blob/f6035db6670de1af2d294e3cb5f6702f8616b53f/src/style/load_sprite.ts#L31C54-L31C70
maplibre-gl-js version: 4.1.1
browser: Chrome Version 123.0.6312.59
Steps to Trigger Behavior
Link to Demonstration
https://jsbin.com/ranucez/edit?html,console,output
Expected Behavior
transformRequest should be called bevor any checks if the URL is valid, eg a relative one
Actual Behavior
Error: Unable to parse URL "/maps/streets/sprite" and transformRequest never gets called for Sprites