mapbox-gl-js
mapbox-gl-js copied to clipboard
source.updateImage doesn't update image if first url is invalid
mapbox-gl-js version: 1.13.2
browser: Chrome 100
Steps to Trigger Behavior
- Create an image source pointing to an invalid url (http 404)
- Change the source url by calling the updateImage method to a valid one
- Create a raster layer pointing to the source
Link to Demonstration
https://jsbin.com/rugilajive/edit?html,js,console,output
Expected Behavior
The map should display the new image.
Actual Behavior
The map doesn't update.
The issue only occurs when the first url is invalid:
invalid -> valid1 -> valid2
: NOK (No image is displayed)
valid1 -> invalid -> valid2
: OK (The valid2 image is displayed)
Hey @manufont can I work on this issue?
Any update on this? even if first url is correct and I use updateImage
right after adding the source, first url is displayed instead of updated one.
https://codepen.io/sienki-jenki/pen/JjeKZJP?editors=1000
demonstration is available here.
First im adding source with image of sofa, but immediately after I'm switching to lake. Unfortunately sofa is displayed.
cc @mourner
@manufont @mourner I opened a PR with a potential solution to this problem in #12928, please take a look if you have some time