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

incorrect interpolation for transitions on hillshade-illumination-direction #5934

Open
stevage opened this issue Jan 3, 2018 · 2 comments
Open
Labels

Comments

@stevage
Copy link
Contributor

stevage commented Jan 3, 2018

mapbox-gl-js version: 0.43.0

Steps to Trigger Behavior

  1. Create a hilshade layer with hillshade-illumination-direction of 359
  2. Call map.setPaintProperty(layername, 'hillshade-illumination-direction', 0)

Expected Behavior

Almost no visible effect.

Actual Behavior

Entire map repaints with large visible flicker.

Easily seen here: https://bl.ocks.org/stevage/raw/a4569595d8592181ab09a5a13166be8d

(The current direction is shown in the URL)

Code: https://gist.github.com/stevage/a4569595d8592181ab09a5a13166be8d

@mollymerp
Copy link
Contributor

yes I see what you mean – I don't think it's triggering a page refresh though, its just transitioning from 359 -> 0 counterclockwise so the light source does almost a full rotation instead of just moving slightly clockwise to 360/0.

A workaround right now is to set transition.duration to 0 https://www.mapbox.com/mapbox-gl-js/style-spec#root-transition

@stevage
Copy link
Contributor Author

stevage commented Jan 9, 2018

Ah, that seems so obvious now :) Thanks.

@mollymerp mollymerp changed the title Changing hillshade-illumination-direction near 0/360 triggers page refresh incorrect interpolation for transitions on light-position and hillshade-illumination-direction Jan 10, 2018
@mollymerp mollymerp changed the title incorrect interpolation for transitions on light-position and hillshade-illumination-direction incorrect interpolation for transitions on hillshade-illumination-direction Jan 11, 2018
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