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

Android-6.0.0-beta.4 : Expression.color(int color) #11502

Closed
Etienne-io opened this issue Mar 22, 2018 · 4 comments
Closed

Android-6.0.0-beta.4 : Expression.color(int color) #11502

Etienne-io opened this issue Mar 22, 2018 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@Etienne-io
Copy link

Platform:Android
Mapbox SDK version:6.0.0-beta.4

I don't know if it is a misunderstanding of Expression.color(int color) or if there is really a bug on it.

Steps to trigger behavior

  1. Expression ex = Expression.color(0x00FF00); OU Expression ex = Expression.color(Color.GREEN);
  2. FillLayer.setProperties(PropertyFactory.fillColor(ex))

Expected behavior

Display green polygon for this layer

Actual behavior

A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 7015 (io.mapwize.app), pid 7015 (io.mapwize.app)

Etienne

@tobrun
Copy link
Member

tobrun commented Mar 22, 2018

For completeness, we also have a couple of color expressions as:

rgb(int red, int green, int blue) and rgba(int red, int green, int blue, int alpha)

That said I'm not able to reproduce your crash:

When I use the following expression:

    Expression textColorExpression = match(get(literal(FEATURE_RANK)),
      literal(1), Expression.color(0xFF00FF00),
      literal(2),  Expression.color(Color.BLUE),
      Expression.color(0xFF00FF00)
    );

screen shot 2018-03-22 at 13 01 00

@tobrun tobrun added Android Mapbox Maps SDK for Android needs information labels Mar 22, 2018
@tobrun
Copy link
Member

tobrun commented Mar 22, 2018

@emerciercontexeo was able to reproduce with the setup shown in OP. To unblock you you can use fillColor(rgba(0.0f, 255.0f, 0.0f, 1f)) for now, this will not crash.

@tobrun tobrun added this to the android-v6.0.0 milestone Mar 22, 2018
@Etienne-io
Copy link
Author

Yes I found other way to do it. It's why i was thinking that something goes wrong with this one.
Thanks for your answer anyway.

@tobrun
Copy link
Member

tobrun commented Mar 23, 2018

landed with #11506

@tobrun tobrun closed this as completed Mar 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants