Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source.updateImage doesn't update image if first url is invalid #11725

Closed
manufont opened this issue Apr 11, 2022 · 3 comments · Fixed by #12992
Closed

source.updateImage doesn't update image if first url is invalid #11725

manufont opened this issue Apr 11, 2022 · 3 comments · Fixed by #12992

Comments

@manufont
Copy link

manufont commented Apr 11, 2022

mapbox-gl-js version: 1.13.2

browser: Chrome 100

Steps to Trigger Behavior

  1. Create an image source pointing to an invalid url (http 404)
  2. Change the source url by calling the updateImage method to a valid one
  3. 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)

@GAURAV1-ui
Copy link

Hey @manufont can I work on this issue?

@sienki-jenki
Copy link

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

@maciejmatu
Copy link
Contributor

@manufont @mourner I opened a PR with a potential solution to this problem in #12928, please take a look if you have some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants