Created
March 4, 2020 15:27
-
-
Save mfazekas/30bac829be4f9af88086e16c6f36ad9d to your computer and use it in GitHub Desktop.
AnimatedCoordinateArray support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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