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
Road animation should be directional #22
Comments
this trick needs some changes on the layer. The oneway yes/no is passed as a 'color:' Look here: https://github.com/tangrams/tangram-sandbox/blob/gh-pages/styles/tron.yaml#L37-L43 Then in the shader we interpret the red color as bidirectional: https://github.com/tangrams/tangram-sandbox/blob/gh-pages/styles/tron.yaml#L139-L148 |
I'm in cross road with this one (see what I just did there ; ) layers:
roads:
data: { source: mapzen }
draw:
lines:
order: 2
width: 5px
color: |
function() {
if (feature.oneway) {
return [0.,1.,0.];
}
return [1.,0.,0.]
} Then in the shader "read" the red channel (or any other) and apply something like this . What's the problem? https://github.com/tangrams/tron/blob/gh-pages/layers/roads.yaml#L71 Here is an example of how hardcoding all the animated roads between @sensescape What do you think? Should I proceed? Note: this should not add to much GPU processing power... |
@sensescape @nvkelso should I proceed w this changes? note: is a destructive change... will to all roads to have a two points (A -> B) gradients and all other color rules for them will be lost |
@sensescape it's possible to tweak the colors to match what it was Colors A -> B are here in lines 12-14 Zoom for A and B are in lines 8-13 |
Verified the directions are now correct for 1 way and 2 way roads (looking at SF). |
@patriciogonzalezvivo If no more work is planned for this, please close issue. |
The text was updated successfully, but these errors were encountered: