Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language switching fixed #134

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Language switching fixed #134

wants to merge 7 commits into from

Conversation

jonathanlurie
Copy link
Collaborator

@jonathanlurie jonathanlurie commented Nov 5, 2024

RD-438

The language switching is now working better and is more robust when there is advance styling or ramping

CHANGELOG.md Outdated Show resolved Hide resolved
src/Map.ts Outdated Show resolved Hide resolved
src/tools.ts Show resolved Hide resolved
@slaviczavik
Copy link
Member

Just a side note, in the map editor is using decodeTextFieldProperty from the style-expressions repo. Basically we decode an expression, analyze from AST what it contains and with updater we replace value where we need to.

@jonathanlurie
Copy link
Collaborator Author

Just a side note, in the map editor is using decodeTextFieldProperty from the style-expressions repo. Basically we decode an expression, analyze from AST what it contains and with updater we replace value where we need to.

Thanks @slaviczavik , i'd like to have a look but i don't have access to this repo. Do you think you can let me in?

src/tools.ts Outdated
* Tst if a string matches the pattern "{name:xx}" in a exact way or is a loose way (such as "foo {name:xx}")
*/
export function checkNamePattern(str: string): { contains: boolean; exactMatch: boolean } {
const regex = /\{name:[a-zA-Z]{2}\}/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are languages with code not matching this regex: name:zh-Hans, name:latin, ... (https://github.com/maptiler/maptiler-client-js/blob/main/src/language.ts)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh true! I'll fix that!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the last commit

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

Successfully merging this pull request may close these issues.

3 participants