-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
mapbox-gl-js version: v2.5.0
browser: Chrome & Firefox
Steps to Trigger Behavior
Create a fallback image expression for a line or polygon. Example:
'fill-pattern': [
"coalesce",
["image", ["get", "icon"]],
["image", "rocket-15"],
]I think that this will occur with any expression that meets the following:
- for
fill-patternorline-pattern - with
coalesce - and with at least one
imagewrapping aget
Link to Demonstration
Expected Behavior
The area with an invalid image name should display as the fallback rocket icon.

Actual Behavior
The area with an invalid image name doesn't render. The console displays:
"Image 'missing-icon' could not be loaded. Please make sure you have added the image with map.addImage() or a 'sprite' property in your style. You can provide missing images by listening for the 'styleimagemissing' map event."
Oddly, changing the second image expression to a string leads to ALL polygons displaying the fallback image:
'fill-pattern': [
"coalesce",
["image", ["get", "icon"]],
"rocket-15"
]When a get statement is included, ALL 'image' expressions inside of the coalesce seem to evaluate to false.
@arindam1993 thoughts on why this might be happening?

