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

Animated Coordinates Array #702

Merged
merged 8 commits into from
Mar 9, 2020

Conversation

mfazekas
Copy link
Contributor

@mfazekas mfazekas commented Mar 3, 2020

Usage:

...
this.coords = new AnimatedCordinatesArray([[1,1],[2,2]])
...
func startAnim() {
  this.coords.timing({
        toValue: [[3, 3], [5, 5], [9, 7]],
        duration: 500,
        easing: Easing.linear,
      })
      .start();
}

...

render() {
...
   <AnimatedShapeSource shape={new AnimatedShape({ type: 'LineString', coordinates:this.coords })} />
...
}

Very similar to the way RN handles animation in style. Expect that for style you don't need new AnimatedStyle as it's handled by createAnimatedComponent.

Compared to #615 the advantage of this approach is that it creates one animation object per array of coordinates, not one per coordinate.

@mfazekas mfazekas force-pushed the mfazekas-animated-line branch from a82c7e6 to fd2e39b Compare March 3, 2020 09:54
@ferdicus ferdicus marked this pull request as ready for review March 3, 2020 11:58
@mfazekas mfazekas force-pushed the mfazekas-animated-line branch from fd2e39b to 8be0b97 Compare March 3, 2020 16:28
@mfazekas mfazekas force-pushed the mfazekas-animated-line branch 3 times, most recently from d91d99d to b089982 Compare March 6, 2020 06:00
@mfazekas mfazekas force-pushed the mfazekas-animated-line branch from b089982 to c4dc199 Compare March 6, 2020 17:28
@mfazekas mfazekas force-pushed the mfazekas-animated-line branch from c2bcd9d to 52c7aed Compare March 9, 2020 09:42
@mfazekas mfazekas merged commit 9118642 into rnmapbox:master Mar 9, 2020
@mfazekas mfazekas changed the title Animated Line Animated Coordinates Array Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants