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

Deemphasize portions of the route line that the user has passed #1307

Closed
1ec5 opened this issue Apr 17, 2018 · 10 comments · Fixed by #2377
Closed

Deemphasize portions of the route line that the user has passed #1307

1ec5 opened this issue Apr 17, 2018 · 10 comments · Fixed by #2377
Assignees
Labels
feature New feature request.
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Apr 17, 2018

Portions of the route line that the user has already passed should be displayed in a more muted or translucent color, to better emphasize the portion that the user still has yet to reach. This effect would be most prominent in overview mode, but even in straight-ahead mode, the line would look different above and below the user puck.

Contrary to the initial explorations in #1162, we’ll keep the line’s geometry constant as the user moves. However, we’ll change the line gradient (MGLLineStyleLayer.lineGradient) to abruptly go from translucent to opaque at the user’s location along the line, with a smooth transition (lineGradientTransition) that matches the puck’s animated interpolation. Line gradients will be implemented in the map SDK for mapbox/mapbox-gl-native#11718.

/cc @mapbox/navigation-ios @danesfeder

@1ec5
Copy link
Contributor Author

1ec5 commented Aug 9, 2018

Line gradients will be implemented in the map SDK for mapbox/mapbox-gl-native#11718.

This is happening in mapbox/mapbox-gl-native#12575. 🎉

@1ec5
Copy link
Contributor Author

1ec5 commented Aug 20, 2018

we’ll change the line gradient (MGLLineStyleLayer.lineGradient) to abruptly go from translucent to opaque at the user’s location along the line, with a smooth transition (lineGradientTransition) that matches the puck’s animated interpolation.

This is blocked by the fact that data-driven properties don’t support transitions: mapbox/mapbox-gl-js#3170. So even once the map SDK supports line gradients, we’d have to constantly change the lineGradient property’s interpolation stops on each frame, which takes us almost back to square one. The advantage over #1162 is that we’d be updating a paint property on each frame rather than regenerating a shape source. So hopefully there won’t be the same flickering effect, but we’ll have to keep an eye on performance.

@1ec5
Copy link
Contributor Author

1ec5 commented Sep 19, 2018

Also blocked by mapbox/mapbox-gl-native#12917, which appears to be much more straightforward to fix than the other blocker, mapbox/mapbox-gl-js#3170.

@1ec5
Copy link
Contributor Author

1ec5 commented Oct 30, 2018

No longer blocked by mapbox/mapbox-gl-native#12917. Still blocked by mapbox/mapbox-gl-js#3170.

@asinghal22
Copy link

@1ec5 Can you please double check the milestone. I accidently put this on 1.1 milestone. I think it is v0.x next.

@1ec5 1ec5 modified the milestones: v0.40.0, v1.1.0 Apr 24, 2020
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 24, 2020

No, it’s correctly slated for v1.1.0.

@captainbarbosa
Copy link
Contributor

@1ec5 is mapbox/mapbox-gl-js#3170 still considered a requirement to complete this feature?

@1ec5
Copy link
Contributor Author

1ec5 commented May 28, 2020

Yes, a port of mapbox/mapbox-gl-js#3170 to gl-native would be required for considering the feature complete, so that the route line would begin at the puck instead of steadily fading in around the puck. However, it doesn’t block initial work to implement the feature.

That PR doesn’t change anything in the style specification, so my assumption is that hard stops entail adding duplicate stops with the same line distance value. The problem with that on iOS is that mgl_stepWithMinimum:stops: accepts a dictionary of stops, which means there can’t be any duplicate stops. It would be fairly straightforward to patch the mgl_stepWithMinimum:stops: function in the map SDK to accept an array as an alternative to a dictionary, but in the absence of any changes to the map SDK itself, we can use MGL_FUNCTION to pass in a stop array directly.

@1ec5
Copy link
Contributor Author

1ec5 commented Jun 25, 2020

#2377 implemented the bulk of the requested feature. We’re tracking some tail work:

@1ec5
Copy link
Contributor Author

1ec5 commented Sep 4, 2020

Fixed in #2377 and #2580.

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

Successfully merging a pull request may close this issue.

4 participants