For many months, I have been attempting to figure out how to go about plotting multiple activities on a single map. An activity to me is a run – I run a fair bit, and the lengths of the runs that I do tend to range from 6 miles up to 18 miles. I live in Edinburgh, and aside from three races I’ve run outside of the city, all of my training runs take place in the city itself, generally starting from and finishing near my house.
What I wanted to do is to plot on a single Google Map every run I’ve done. I use a Garmin Forerunner 405, and I’ve recently purchased a Garmin Forerunner 910xt, and I use the standard Garmin Connect utility which stores all of my training runs. This therefore means I can see each run on Garmin Connect and see the plot of where I’ve been. One run at a time.
But I want them all on one map.
I had tried for many months to figure out how to plot these runs on Google Maps, and it turns out I was always searching for the wrong thing. Rather than bore you with where I went wrong, I’ll tell you how I did it. And it was pretty easy (isn’t everything easy when you know how?).
Ultimately, you want to plot multiple polylines on a single map. Each polyline is a single activity, so in my case, each polyline was a single run.
[ edit: I’ve since created a web application which means you can now get this functionality without having to run any scripts on your own computer – more on that at the end of the article… this next bit is therefore fairly redundant if you use the web app ]
The runs I exported as TCX files from Garmin Connect. Now, I had 139 runs to export, so that took a few minutes, but not the end of the world.
I’ll explain how to go about creating your map, but first, here’s mine:
function initialize_46521721() and all that each of these files are doing is creating an array of
coords with each latitude/longitude point, which came from the TCX files. In other words, the TCX file shows all of the GPS points that I ran along, and I’m just creating a line (a polyline) from these GPS points. If you look down the very bottom of the js/46521721.js file, you’ll see a flightPath variable being created and a call to setMap(); these bits are the same in every single initialize_123() type method.
Hope this helps someone…
[ edit – and here’s the info about the web application ]
So I ended up deciding to create a web application, mainly to make it easier for me to upload new activities without having to re-run the scripts on my machine. This web application is also built so anyone can use it and see their own multiple activities on their own map. It’s not finished yet, but it does work and I’ll be continuing to make updates to it regularly until it reaches a point of being fully functional, configurable and looks vaguely half decent. The web app is here:
It’s free, your password is stored securely (SHA1 hashed, if you’re interested) and I won’t send you spam or sell your email to anyone, honest.