So I have the sandbox of code right now which is plotting polyline data based on the option selected the issue is right now from the code i have provided if you run the first one initially then quickly hit the button again to pause it then change the select value to option 2 and run again it seems to plot a line between the two. Where as I want the replayMap to re render itself when the options selected changes so that the data that is going to be plotted is only the data from the current select menu value. So basically cannot figure out how to set nextPosition state or props.activityData back to empty after the user chooses a new select menu option:
code sandbox link: https://codesandbox.io/s/distracted-sun-jwk3dg?file=/src/ReplayMap.js
I have been at this for hours but still cannot seem to find where I am going wrong can anyone that is more experienced in react spot my fault
