You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The image operator introduced in #8684 can sometimes short-circuit the styleimagemissing operator, even if no image is found. This happens because the operator returns null when an image is not found in the style.
Design
We should recognize when an image operator evaluates to null and determine which image was requested, then return that image's name, instead of null. This needs to happen after evaluation so that the image operator works with coalesce statements. In such a statement, there will likely be several images requested. A simple heuristic can be used to determine which image we should fire styleimagemissing for; we should be able to treat an expression with several images in it as analogous to a font-stack in which we assume that the most desired option is the first one listed, so we should determine what the first image requested was and use that to fire styleimagemissing.
Concepts
#8684#7987 and the coalesce operator are the key concepts
Implementation
I have a pretty good jump on implementation. I think the best place to implement this is within the getValueAndResolveTokens method:
Motivation
The
image
operator introduced in #8684 can sometimes short-circuit thestyleimagemissing
operator, even if no image is found. This happens because the operator returnsnull
when an image is not found in the style.Design
We should recognize when an
image
operator evaluates tonull
and determine which image was requested, then return that image's name, instead ofnull
. This needs to happen after evaluation so that theimage
operator works withcoalesce
statements. In such a statement, there will likely be several images requested. A simple heuristic can be used to determine which image we should firestyleimagemissing
for; we should be able to treat an expression with several images in it as analogous to a font-stack in which we assume that the most desired option is the first one listed, so we should determine what the first image requested was and use that to firestyleimagemissing
.Concepts
#8684 #7987 and the
coalesce
operator are the key conceptsImplementation
I have a pretty good jump on implementation. I think the best place to implement this is within the
getValueAndResolveTokens
method:mapbox-gl-js/src/style/style_layer/symbol_style_layer.js
Lines 95 to 103 in 5edbaf1
cc @asheemmamoowala @alexshalamov
The text was updated successfully, but these errors were encountered: