This repository is Flask web application that plot cycling route with Google Maps API and Flask
Switch branches/tags
Nothing to show
Clone or download
Henry Cheung Henry Cheung
Henry Cheung and Henry Cheung edit code example
Latest commit 63b1aa1 Mar 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
templates
20180117_023924.tcx.xml
Amakusa_day1.tcx.xml
LICENSE
README.md
app.py
bikeroute.py
requirements.txt

README.md

Plot cycling route with Google Maps API and Flask web framework

This repository contains python code that parse a cycling activity TCX file and plot the route with Google Maps API and Flask web framework.

A Simple Example

from bikeroute import Map, Route
from flask import Flask, render_template

app = Flask(__name__)
app.config['API_KEY'] = "copy_and_past_google_map_API_key_here"
route = Route("20180117_023924.tcx.xml")
map = Map(route.trackpoints)

@app.route('/')
def index():
    context = {
        "key": app.config['API_KEY'],
        "title": route.title
    }
    return render_template('template.html', map=map, context=context)

For more details about the codes, refer to my blog post How to plot cycling route with Google Maps API and Flask web framwork.