Back in July I had my first experience with bookmarklets when playing with Marc Durdin’s excellent bit of code that provides his funky elevation profiles for Activities and Segments right there, in amongst Strava’s own page contents. I might have been a bit naive but I just didn’t realise that this thing was so easy to do, so time for a quick play and see what I could come up with. First off I wanted to get an interactive 3D view of the new Strava Routes, the other thing that sprung to mind was to see if I could swap out the Google Maps view for the more detailed (at least here in the UK) Open Street/Cycle Maps which I’ll go into in my next blog post.
Update: unfortunately this approach to getting data for the 3D viewer is remarkably unstable due to the ever changing code at each of the sites mentioned above. Currently I think all of the sites listed have changed their code sufficiently for my code to no longer work and I’m not going to attempt to maintain it. Instead I’ve added a GPX import option on the 3D routes page but it does rely on the GPX file including elevation data. The GPX export from Strava doesn’t so that won’t work so the best site I’ve found so far to create your GPX files is Ride With GPS. The elevation data isn’t the best though so don’t expect very good profiles (Garmin Connect appears to have the best elevation data right now but there is no GPX export!). Of course if you’ve ridden the route then just view your activity on VeloViewer and you’ll see a 3D view there.
Update: Now working for Strava, Garmin Connect, Ride With GPS and Bike Route Toaster!
3D Routes, Activities and Segments
For a while now you have been able to view 3D elevation profiles for any segment on my Segment Details page (e.g. Alpe d’Huez). Clicking on the 3D tab shows you a colourful graphic depicting the segment in all its glory. Not only that but you can click (or touch) and spin the thing round and tilt it to find the best view.
Now that I had the code to create the 3D view all I needed was to get my hands on the data for the new Starva Routes. I’m guessing the API to provide this data will be a long way off but inspired by Mr Durdin I set about seeing if I could grab the data right out of the Strava page and pass it across to my code – and sure enough you can! Not only that but it was only a minor tweak to get the data for activities (now including runs) as well. Now these can be anyone’s activities or routes, as long as you can see the details for it in Strava then you can use this 3D view. Here’s one of Laurens ten Dam from this year’s Tour:
How to do it
Just visit the 3D Route/Activity Viewer page and follow the instructions. It has been simplified since the first incarnation in that you no longer need to allow for popups. Also more detailed, browser specific instructions are given to walk you through setting up your bookmark. Once you’ve got that bookmark set up it is as simple as navigating to the Strava, Garmin Connect, Ride With GPS or Bike Route Toaster page of your choice and clicking your bookmark.
The code also works on iPhone and iPads now although the process of setting up your bookmark is a little more involved (once again, full instructions are given).
If you are viewing a segment on Strava (segment details page, not a activity’s segment effort) then the same bookmark will navigate you to the VeloViewer segment details page where you can view the 3D view along with all the other details.