I am using the Get Activity ById endpoint from the Strava API whcih returns a ActivityDetail object.
I can decode the polyline but it only returns the lat and lng values for each vertex.
I decode using:
import polyline from '@mapbox/polyline';
import { LatLngExpression } from 'leaflet';
export const decodePolyline = (
encodedString: string | undefined,
): LatLngExpression[] => {
if (!encodedString) return [];
const decoded = polyline.decode(encodedString);
return decoded;
};
I would like to get the altitude in order to draw the elevation graph too. Is there a different API call available to retrieve this data?
If your interested the repo Imj workin in is here: https://github.com/loanburger/strava-react-app
Thanks!
I have found another solution to this problem and wanted to share the approach. There is a ActivityStream API which can be used. It takes in the activity Id and the stream type you want then returns a stream result with the types you want:
A sample response for example the distance stream would look like:
This basically gave me exactly what I was after.