Include ['map']['polyline] in GET /athlete/activities

585 views
Skip to first unread message

Anders Hasselstrøm

unread,
Aug 21, 2018, 12:33:23 PM8/21/18
to Strava API
Hi, 

Never touched the Strava API before so bear with me. 

I have two issues at the moment:

1) I GET /athlete/activities to make a feed on a user profile. In the feed I want to show the map with the exact route. Ideally, I would use ['map']['polyline'] but in the activities list it's only ['map']['summary_polyline'] that is returned. Is there a way to get ALL lats and longs using that endpoint? Summary only provides the start and finish lat and long.

2) General question about map building; I want to show a map for every activity I loop through. However, using Google Maps I can't build several maps using a for loop. Any other map building libraries you'd recommend? I have described the issue here: https://stackoverflow.com/questions/51951983/include-google-maps-in-loop-to-show-several-maps

Thanks, 
Anders

Anders Hasselstrøm

unread,
Aug 21, 2018, 12:36:48 PM8/21/18
to Strava API
I'm assuming this is not the case but I'll ask anyway. Is it possible to query the API for a thumbnail of the maps image? If that is doable, I would not bother drawing the maps myself.

Maciej Zgadzaj

unread,
Aug 21, 2018, 3:54:01 PM8/21/18
to Strava API
1) I GET /athlete/activities to make a feed on a user profile. In the feed I want to show the map with the exact route. Ideally, I would use ['map']['polyline'] but in the activities list it's only ['map']['summary_polyline'] that is returned. Is there a way to get ALL lats and longs using that endpoint? Summary only provides the start and finish lat and long.

Not sure how it works for activities, as in my Route Explorer web app I am dealing with routes only - but in case of routes "summary_polyline" is perfectly enough for drawing a small route thumbnail. 
 
2) General question about map building; I want to show a map for every activity I loop through. However, using Google Maps I can't build several maps using a for loop. Any other map building libraries you'd recommend?

In my case I am saving generated thumbs locally when a route is first added, and then serve them from there, to avoid hundreds/thousands/even more in future of calls to an API to show all thumb each time anyone browses the listing. I am using MapQuest for generating the thumbs - https://developer.mapquest.com/documentation/static-map-api/v5/map/ - Google has something similar - but it doesn't really matter, you should be able to render multiple maps using any service, it should just be a matter of id-ing (and perhaps naming) them properly.

Daniel D.

unread,
Nov 23, 2018, 12:12:09 PM11/23/18
to Strava API
I have some Ruby code that works well in https://github.com/dblock/slack-strava/blob/master/slack-strava/models/map.rb that generates a Google Maps link using the summary polyline.

Elizabeth Glenn

unread,
Nov 25, 2018, 7:44:40 PM11/25/18
to Strava API
Hi Anders,

I've used the leaflet app to map coordinates.  I think using a for loop for a list of coordinates should be feasible, as I was able to map several routes on the same map with leaflet.  I'm using Python.  If you are as well, this blog may be helpful:  https://markhneedham.com/blog/2017/04/29/leaflet-strava-polylines-osm/
Reply all
Reply to author
Forward
0 new messages