Skip to content

Instantly share code, notes, and snippets.

@mfazekas
Created March 4, 2020 15:27
Show Gist options
  • Save mfazekas/30bac829be4f9af88086e16c6f36ad9d to your computer and use it in GitHub Desktop.
Save mfazekas/30bac829be4f9af88086e16c6f36ad9d to your computer and use it in GitHub Desktop.
AnimatedCoordinateArray support
this.state = {
...
coordinates: new MapboxGL.AnimatedCoordinateArray([[lon + delta, lat], [lon, lat], [lon, lat + delta]])
...
}
...
this.state.coordinates
.timing({
coordinates: [
[lon + delta, lat],
[lon, lat],
[lon + delta, lat + delta],
],
duration: time,
easing: Easing.linear,
})
.start();
...
<MapboxGL.Animated.ShapeSource id={'shape'} shape={{
type: 'LineString',
coordinates: this.state.coordinates
}}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment