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.

Serialize tokens in expressions as get expressions #11659

Closed

Description

@1ec5

A serialized expression should never contain token syntax. As of #11509 and #11452, if style JSON contains a text-field property set to a legacy function, the runtime styling getter for that property returns an expression containing strings with tokens in them. So simply getting a text-field then setting text-field to the same value will turn tokens into literal {token}s on screen.

For #11651, I’m working around this issue by implementing an “upgrade” step in Objective-C that replaces tokens with mgl_join: and key path expressions, but an mbgl implementation would be somewhat more performant and benefit more platforms.

/cc @anandthakker

Activity

  1. added
    Core
    on Apr 11, 2018
  2. self-assigned this
    on Jun 28, 2018
  3. 1ec5 commented on Jul 17, 2018

    @1ec5
    ContributorAuthor

    For #11651, I’m working around this issue by implementing an “upgrade” step in Objective-C that replaces tokens with mgl_join: and key path expressions

    Unfortunately, #11651 didn’t address the reverse operation: setting a property to a constant string expression should’ve also prevented the legacy {token} syntax, perhaps by turning the string into a trivial concat expression. But #12402 is going to remove token string support from mbgl anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Corebugruntime styling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions