How to use Google Map Tracks & Embed Tracks on your Website

Below are 20 steps to creating a track in Google maps, converting it from a kml file to a gpx file for transferring it to your GPS device, then downloading your recorded gpx track & converting it back to kml for use in Google maps & embedding your tracks on a Google Map in your website, as I do it for our website. You will need to setup a Google Maps account & download Google Earth for free. I use a Garmin GPSmap 62s device & MapSource.
  1. Sign in to your Google account and click on ‘Get directions’. Use the boxes to write in your location & destination. Google will create a blue track between your points ‘A’ & ‘B’, following roads & tell you the distance & detailed directions to your destination. You can click on the track to add a point, which you can then drag around to include other roads. You can also type in a search item, such as hotel/hostel/guesthouse & the map will display all the hotels in the area; you can right-click on any hotel and select ‘Directions to here’ to change your destination.
  2. Once you are happy with your track you need to save it; scroll down on the left side toolbar until you see a ‘Save to My Maps’ button. Select 'Create a new map' & click on the 'save' button save the track to the 'My Places' folder. Your track will open in a new window and you can 'Edit' it further (change the name or colour of the track).
  3. After saving the track & clicking on 'Done' you have the option to export it as a kml file. Click on the ‘kml’ link & save in an appropriate folder.
  4. Use this link to convert the kml file into a gpx file for use on a Garmin device:                GPS Visualizer
  5. Save the gpx file to an appropriate folder eg: ‘Planned gpx Tracks’ with a suitable filename.
  6. Open the file in Garmin MapSource for transferring onto your device. Note that for some Garmin devices you will have to reduce or ‘filter’ the track points to 50 before transferring it; Do this by right-clicking on the track & selecting ‘Track Properties’, then ‘Filter’; where you have the option to reduce the points to 50 ‘Maximum Points’. Click ‘ok’. Check the ‘Name’ of the track is as you want it then click ‘ok’.
  7. Connect your GPS device & transfer the track. Disconnect your GPS device, and then turn it on to check your track was transferred, under ‘Main Menu’/’Track Manager’. There you will find the track under the name you saved it; select it and ‘View Map’ then simply select ‘Go’ to follow it.
  8. The GPS device will create a new track of where you’ve been, under ‘Current Track’ in the Track Manager. When you’ve reached your destination you can save the track & transfer it back to MapSource for use on your website. Depending on how many days you’ve travelled, the Garmin device will either combine the tracks under ‘Current Track’ or store them under ‘Archived Tracks’. The Garmin device also gives you the option to save tracks daily in its Main Menu. To transfer your current track, go to ‘Track Manager’ and select ‘Current Track’ and ‘Save Track’, as the date filename they suggest.
  9. Connect your GPS device to your computer; the device will ask ‘Connect to Mass Storage’; select ‘yes’. A new window will open on your desktop. Click ‘Garmin’/’gpx’ and find the saved current track under the date you saved it. Copy this over to a suitable folder on your hard drive.
  10. Open the track in MapSource. Right-click on the track & select ‘Track Properties’. Change the track ‘Name’ to something, such as the location, which you want people to read when they click on it through your website.
  11. If you want to group several days of tracks under one long track you can simply ‘select all’ in this properties box, click ‘copy’ and paste it into another file with a track – in the correct date order (I click on ‘end’ at the end of the points to paste more tracks). If you want to split combined tracks into separate tracks save a copy of the track then delete selected points by date.
  12. Your Garmin device will have saved several points per track (seen under ‘Index’ in the properties box). Unfortunately Google Maps can only store about 300 points per track before it starts splitting one track into two or more. So again we need to ‘Filter’ the points to a maximum of 300. You can either follow Step 6 above or after clicking ‘Filter’ select ‘Automatic’ & ‘Fewer Points’. You might have to do this a few times until your ‘Index’/points number reduces to around 300. By reducing points this way your track will become less rigid between points, sticking to the bends in roads for example, rather than jumping them.
  13. Save the filename as a ‘gpx’ file, under an appropriate name; I always add the number of track 'points' to the end of the filename, eg: ‘Laos Tracks-300’, and keep a copy of the detailed file with all the points.
  14. I use Google Earth to open this gpx file to convert it into a kml file; Open your file in Google Earth selecting ‘All files’ to find the ‘gpx’ file. Select ‘Create KML Tracks’ & ‘Adjust altitudes to ground height’. The track will be shown in blue.
  15. Right-click on the track & select ‘Save Place As…’ then choose a new folder, such as ‘website kml tracks’ to save the file in, and select ‘kml’ to save it as a .kml file.
  16. Now you can upload this into Google Maps. Sign-in to your account; select ‘My Places’, then ‘Create Map' and 'Import' to upload the .kml file.
  17. Hopefully only one track will be created, not a split track. You can then edit this, change the colour of the track & name & add any markers. To view the track as ‘miles’ I use googlemaps.co.uk but if I want to have the track in ‘km’ on my website I sign-in to googlemaps.de
  18. Once you’ve saved your track you can choose to view it in either satellite, or simple street-map or terrain mode; I choose the ‘terrain’ background for our website, as when you zoom in you can also see the contour lines of the mountains we cycle over.
  19. To save a script of the map click on ‘Link’ (beside the 'printer' button in the side toolbar) & ‘Customise and preview embedded map’. (If you are not able to select this try logging out & in again.)
  20. A new window will open where you can customise the size of your map. Select and copy the HTML script to embed it onto your website. I use Basekit.com for our website, which has an ‘embed’ widget where I can easily paste the script into.

Hope these steps help. This is the way I plan our cycle tracks.
Comments or suggestions below please!

1 comment:

  1. Hello, I suggest to take a look at this free conversion program. http://gpx2kml.com/ makes gpx files into kml and the other way around. Simple and easy to use, it generates fast results and converted files can be easily downloaded also. Maybe you wanna try it!