Raster layers have black background on iOS
Hey guys,
I added a raster layer, which is a overlay of a masterplan, onto my map following this guide: https://www.mapbox.com/help/georeferencing-imagery/ . Everything looks fine in chrome, but when I run in inside of a cordova app on ios, the raster layer has a black background that covers everything underneath. I tried moving the layer down, but the black still comes through where there's nothing else on top. Is there a way to remove this background color on ios?
Thanks!!
Any update on this one, guys?
No update @johnnyluu. Unfortunately, we don't have the capacity to spend time debugging Cordova here at Mapbox. We would appreciate if you could investigate the issue and submit a patch 😄
Hey @lucaswoj , is not a Cordova issue. It happens in the browser on iOS as well
@johnnyluu What format is the Tileset reported as? (see https://www.mapbox.com/studio/tilesets/YOUR_TILESET_ID)
If it's webp, then it's because iOS Safari doesn't support webp (which support transparency), so it's falling back to JPG tiles which lack transparency, I think.
Can you post the Style ID or Tileset ID?
Closing as stale
@andrewharvey @lucaswoj Sorry I didn't notice the update.
Yes the tileset IS in webp format. I followed this tutorial here to georeference the image: https://www.mapbox.com/help/georeferencing-imagery/ . What should I do to create a tileset that's supported by iOS, so it doesn't display the background colour?
tileset ID: brightfox.7h3843ej
I see that this was closed. However this still happens on iOS with the latest SDK. Were any fixes related to this ticket incorporated?
I am having the same issue, the 'black background'. Has this been resolved? Could someone help please?
Hi @baptistae I think there's potentially a few causes of and solutions to this issue but it's impossible to say without more information. If you believe this is a bug in Mapbox code and not a browser support issue or general how-to question, please update this ticket with a minimal reproduction of the bug. Otherwise, I'd recommend ensuring that you're not using WebP tiles as discussed above and contacting our support team if you have further questions.
Hi @ryanhamley,
The black background I meant can be seen in the link below.
https://api.mapbox.com/styles/v1/ebaptista/cjnwlpcih6rgr2sqk24kd7qim.html?fresh=true&title=true&access_token=pk.eyJ1IjoiZWJhcHRpc3RhIiwiYSI6ImNqaDFkMW41NjAycWMzM3J5ZWozd2hwZXoifQ.-s9u1p7IopNgLegMxdf53A#14.0/-8.576514/125.546172/0
Thanks
This is caused by the use of JPG raster tiles which do not support an alpha channel. This renders as expected in Chrome but not Safari, because Chrome supports WebP images (notice the extra requests for WebP images in Chrome Dev Tools' Network tab). You can see detailed discussion of the issue here. The linked issue also discusses possible workarounds such as turning the image into an Image source on the map. Unfortunately, there's no easy solution to implement on our end because of the limitations of the JPG format and browser support for WebP.
Thanks @ryanhamley for the prompt reply and the explanation.
Cheers