Add route to map directly from strava #487
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds the functionality to allow an admin to configure rg2 to allow users to upload a recent activity directly from Strava and use them as route drawings. It makes it easier for users as they do not need to download the gpx file then reupload the file to rg2.
The configuration for admins is simple. Simply create a Strava API application and retrieve the application oAuth2 client and secret. Define STRAVA_CLIENT and STRAVA_SECRET in rg2-config.
If the oauth values are undefined, the user will not see the 'Get 10 most recent strava activities' button.
If defined, the user will see a button in the Draw tab which will allow them to sign in to strava via an oauth popup window, and the application will list their 10 most recent activities. They can then select one to add it to the map.
I did have to bodge the existing GET listener to accept the oauth code parameter. Can't see any way around this.