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

Expression transformations #10944

@1ec5

Description

@1ec5

In the iOS and macOS SDKs, automatic label localization (MGLStyle.localizesLabels) replaces references to one name_* field with another in every symbol layer. This is a trivial operation for constant expressions and was a manageable operation for legacy style functions, but expressions are far too complex to transform in an ad-hoc manner. For now, #10726 will avoid localizing non-constant expressions, and #10713 would reenable the feature for data and/or camera expressions.

Essentially what’s needed is a way to visit every subexpression and transform it according to a block. It might piggyback on eachChild() to some extent, but it would recurse through the entire subexpression tree, and the callback would return a replacement object. This transformation function could be implemented purely at the Objective-C level, but a pure C++ implementation would be much more robust, avoiding any risk from lossy roundtripping between C++ and Objective-C types.

/cc @anandthakker @tobrun

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions