Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Color is ignored in format expressions when part of a match expression. #14254

Closed
fabian-guerra opened this issue Mar 27, 2019 · 1 comment · Fixed by #14259
Closed
Assignees
Labels
Core The cross-platform C++ core, aka mbgl expressions

Comments

@fabian-guerra
Copy link
Contributor

When a format expression containing a text color parameter is included as part of a match expression and set to SymbolStyleLayer.text property is ignored.

Steps to trigger behavior

  1. Create the following expression:
NSExpression *expression = [NSExpression expressionWithMGLJSONObject:@[@"match", @[@"-", @2, @1],
                                                                           @1, @[
                                                                           @"format",
                                                                           @[@"get", @"name"], @{},
                                                                           @"\n", @{},
                                                                           @[@"get", @"name"], @{ @"font-scale" : @0.8,
                                                                                                  @"text-color" : @"red",
                                                                                                  @"text-font" : @[@"literal" , @[@"Arial Unicode MS Bold"]] },
                                                                           ], @"Foo"]];
  1. Set the expression to a MGLSymbolStyleLayer.text property.

Expected behavior

The text color in the second line should be red.

Actual behavior

The text color in the second line is black.

cc @alexshalamov @chloekraw @julianrex @1ec5

@fabian-guerra fabian-guerra added Core The cross-platform C++ core, aka mbgl expressions labels Mar 27, 2019
@alexshalamov alexshalamov self-assigned this Mar 27, 2019
alexshalamov added a commit that referenced this issue Mar 28, 2019
Before this change, symbol layer was only checking whether top level
'text-field' layout property expression is FormatExpression and if it
has paint property overrides. This change takes into account that
'text-field' might have nested expressions, thus, requires traversal
over child expressions.

Fixes: #14254
alexshalamov added a commit that referenced this issue Mar 28, 2019
Before this change, symbol layer was only checking whether top level
'text-field' layout property expression is FormatExpression and if it
has paint property overrides. This change takes into account that
'text-field' might have nested expressions, thus, requires traversal
over child expressions.

Fixes: #14254
@fabian-guerra
Copy link
Contributor Author

Fixed in #14259

alexshalamov added a commit that referenced this issue Apr 1, 2019
Before this change, symbol layer was only checking whether top level
'text-field' layout property expression is FormatExpression and if it
has paint property overrides. This change takes into account that
'text-field' might have nested expressions, thus, requires traversal
over child expressions.

Fixes: #14254
alexshalamov added a commit that referenced this issue Apr 1, 2019
Before this change, symbol layer was only checking whether top level
'text-field' layout property expression is FormatExpression and if it
has paint property overrides. This change takes into account that
'text-field' might have nested expressions, thus, requires traversal
over child expressions.

Fixes: #14254
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl expressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants