add bus stops to the map
This commit is contained in:
parent
f1e1947b51
commit
47d21fd1a9
2 changed files with 11 additions and 4 deletions
10
app.py
10
app.py
|
@ -6,17 +6,19 @@ app=Flask(__name__)
|
|||
app.config['CACHE_TYPE']='SimpleCache'
|
||||
cache=Cache(app)
|
||||
|
||||
data=requests.get("https://tarc.rideralerts.com/InfoPoint/rest/Routes/GetVisibleRoutes").json()
|
||||
routes=",".join(str(r.get("RouteId")) for r in data)
|
||||
data=requests.get("https://tarc.rideralerts.com/InfoPoint/rest/Stops/GetAllStops").json()
|
||||
stops={s.get("StopId"):[s.get("Latitude"),s.get("Longitude")] for s in data}
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("map.html")
|
||||
return render_template("map.html",stops=stops)
|
||||
|
||||
@app.route("/bus.svg")
|
||||
def favicon():
|
||||
return send_from_directory(app.static_folder,"bus.svg")
|
||||
|
||||
data=requests.get("https://tarc.rideralerts.com/InfoPoint/rest/Routes/GetVisibleRoutes").json()
|
||||
routes=",".join(str(r.get("RouteId")) for r in data)
|
||||
|
||||
@app.route("/tarc.csv")
|
||||
@cache.cached(timeout=5)
|
||||
def tarc():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue