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

Serialize tokens in expressions as get expressions #11659

Closed
1ec5 opened this issue Apr 11, 2018 · 1 comment
Closed

Serialize tokens in expressions as get expressions #11659

1ec5 opened this issue Apr 11, 2018 · 1 comment
Assignees
Labels
bug Core The cross-platform C++ core, aka mbgl runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented Apr 11, 2018

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

@1ec5
Copy link
Contributor Author

1ec5 commented Jul 17, 2018

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl runtime styling
Projects
None yet
Development

No branches or pull requests

2 participants