mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

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

Open manufont opened this issue 2 years ago • 1 comments

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)

manufont avatar Apr 11 '22 13:04 manufont

Hey @manufont can I work on this issue?

GAURAV1-ui avatar Jul 21 '22 00:07 GAURAV1-ui

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

sienki-jenki avatar Jun 20 '23 09:06 sienki-jenki

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

maciejmatu avatar Oct 12 '23 09:10 maciejmatu