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

Add expression in. - #171

Merged
Chaoba merged 2 commits into
masterfrom
kl-expression-in
Feb 19, 2020
Merged

Chaoba merged 2 commits into
masterfrom
kl-expression-in

Conversation

@Chaoba

@Chaoba Chaoba commented Feb 12, 2020

Copy link
Copy Markdown
Contributor

This pr add the interface for expression in. Not include the corresponding pr in core sdk now.
@mapbox/maps-android any suggestion on how to test it?

@Chaoba Chaoba self-assigned this Feb 12, 2020

@tobrun tobrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can test your changes by updating the vendor/mapbox-gl-native submodule pin to your PR in mapbox-gl-native. Once that is merged we can set the submodule pin to master.

@Chaoba

Chaoba commented Feb 12, 2020

Copy link
Copy Markdown
Contributor Author

You can test your changes by updating the vendor/mapbox-gl-native submodule pin to your PR in mapbox-gl-native. Once that is merged we can set the submodule pin to master.

That's right. We'd better add an option in RuntimeStyleActivity to test express in, but I am not sure how it should be used in app. Can you give an example about it?

@tobrun

tobrun commented Feb 12, 2020

Copy link
Copy Markdown
Member
 ["in", needle: (boolean, string or number), haystack: (array or string)]: boolean

The returned boolean value can be used with case expression:

["case",
    condition: boolean, output: OutputType,
    condition: boolean, output: OutputType,
    ...,
    fallback: OutputType
]: OutputType

So you could make a textSize of a certain city bigger if it contained the word "york":

  • New york
  • York

@Chaoba

Chaoba commented Feb 13, 2020

Copy link
Copy Markdown
Contributor Author

It seems works well.
device-2020-02-13-141730

@Chaoba
Chaoba requested a review from a team February 18, 2020 05:31
@chloekraw

Copy link
Copy Markdown
Contributor

cc @mapbox/maps-ios @alexshalamov

@Chaoba
Chaoba merged commit 18264df into master Feb 19, 2020
@Chaoba
Chaoba deleted the kl-expression-in branch February 19, 2020 00:53
@tobrun tobrun mentioned this pull request Feb 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants