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

Gradient Polylines not working on Samsung devices #6442

Closed
d-prukop opened this issue Apr 2, 2018 · 2 comments
Closed

Gradient Polylines not working on Samsung devices #6442

d-prukop opened this issue Apr 2, 2018 · 2 comments
Labels

Comments

@d-prukop
Copy link

d-prukop commented Apr 2, 2018

mapbox-gl-js version: pre-release #6303

Steps to Trigger Behavior

This issue was reported to me by a client. The conversation follows:

We are experimenting with running our web stack on an android tablet by packaging our project with Cordova. When we do this, everything works except the route line is mysteriously gone. There are no errors being thrown but I am wondering if perhaps since we are building the project for PROD it may be disabling some beta features like the routeline?

Let me know if you have any ideas.

Thanks!


It seems I can render the line just fine, but when I try to update it with the gradient to make it draw behind the car it disappears :(
So this is the code that would normally work just fine in rendering the line but on our cordova packaged app seems to erase the line.
I checked to make sure percentComplete was a valid value and map was defined :/

 map.setPaintProperty('routeLayer',
    'line-gradient',
    this.makeGradient(
      [
        0, 'rgba(84, 11, 184, 0)',
        percentComplete + 0.02, 'rgba(84, 11, 184, 0)',
        percentComplete + 0.15, 'rgba(84, 11, 184, 1)',
        1, 'rgba(84, 11, 184, 1)']));

The TL;DR is Android Cordova, while simply being a webhost inside of an app with hooks to the OS is that it's very finicky about how it loads resources. Even simple things like having a leading "/" before a file can hose the whole thing. We had to customize our webpack output to get around this. We'd love to do the same for this file and see if that alleviates the issue.

Thanks!


Thanks for the links, Dave. We finally narrowed this down. It would appear all of our recent Samsung devices fail to show the route line. While it works fine on PC, iOS, and older Samsung phones. This is with Cordova removed from the equation too. Just a simple HTML browser. Any ideas?

Expected Behavior

Actual Behavior

@lbud
Copy link
Contributor

lbud commented Apr 5, 2018

Thanks @d-prukop! Glad we caught this — looks like the default precision on those devices isn't high enough for the 15 bit varying necessary for this feature. This should be fixed on the relevant branch after 4ad7ecb (verified on a test device I found here; please reopen if this doesn't fix the issue on your/client's end).

@lbud lbud closed this as completed Apr 5, 2018
@d-prukop
Copy link
Author

d-prukop commented Apr 5, 2018

Client has confirmed that this works for them. Thank you @lbud

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

No branches or pull requests

2 participants