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

Add expression in. #171

Merged
merged 2 commits into from
Feb 19, 2020
Merged

Add expression in. #171

merged 2 commits into from
Feb 19, 2020

Conversation

Chaoba
Copy link
Contributor

@Chaoba Chaoba commented Feb 12, 2020

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
Copy link
Member

@tobrun tobrun left a comment

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
Copy link
Contributor Author

Chaoba commented Feb 12, 2020

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
Copy link
Member

tobrun commented Feb 12, 2020

 ["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
Copy link
Contributor Author

Chaoba commented Feb 13, 2020

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
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.

None yet

3 participants