normalize quoting
This commit is contained in:
parent
2b8cad744e
commit
2b8dd9f28d
2 changed files with 6 additions and 9 deletions
2
app.py
2
app.py
|
@ -15,7 +15,7 @@ def favicon():
|
||||||
return send_from_directory(app.static_folder,"bus.svg")
|
return send_from_directory(app.static_folder,"bus.svg")
|
||||||
|
|
||||||
data=requests.get("https://tarc.rideralerts.com/InfoPoint/rest/Routes/GetVisibleRoutes").json()
|
data=requests.get("https://tarc.rideralerts.com/InfoPoint/rest/Routes/GetVisibleRoutes").json()
|
||||||
routes=",".join(str(r.get('RouteId')) for r in data)
|
routes=",".join(str(r.get("RouteId")) for r in data)
|
||||||
|
|
||||||
@app.route("/tarc.csv")
|
@app.route("/tarc.csv")
|
||||||
@cache.cached(timeout=5)
|
@cache.cached(timeout=5)
|
||||||
|
|
|
@ -2,15 +2,12 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta property="og:site_name" content="TARC">
|
|
||||||
<meta property="og:title" content="TARC Routes">
|
|
||||||
<meta property="og:description" content="Watch the live locations of TARC vehicles and stops around Louisville">
|
|
||||||
<title>TARC Routes</title>
|
<title>TARC Routes</title>
|
||||||
<meta name="description" content="Watch the live locations of TARC vehicles and stops around Louisville">
|
<meta name="description" content="Watch the live locations of TARC vehicles and stops around Louisville">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="/bus.svg">
|
<link rel="icon" href="bus.svg" type="image/svg+xml">
|
||||||
<script src="https://stevenalexander.org/leaflet/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
|
<script src="static/leaflet/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
|
||||||
<link rel="stylesheet" href="https://stevenalexander.org/leaflet/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
|
<link rel="stylesheet" href="static/leaflet/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
|
||||||
<style>html,body{height:100%;margin:0;}#map{height:100vh;}</style>
|
<style>html,body{height:100%;margin:0;}#map{height:100vh;}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -26,7 +23,7 @@ function updateMap(){
|
||||||
data.split("\n").forEach(line=>{
|
data.split("\n").forEach(line=>{
|
||||||
let [lat,lng,r,id,p,d,s,t]=line.split(",");
|
let [lat,lng,r,id,p,d,s,t]=line.split(",");
|
||||||
p=parseInt(p);
|
p=parseInt(p);
|
||||||
t=new Date(t*1000).toLocaleTimeString('en-US',{hour12:false});
|
t=new Date(t*1000).toLocaleTimeString("en-US",{hour12:false});
|
||||||
if(!busLayers[r]){busLayers[r]=L.layerGroup().addTo(map)}
|
if(!busLayers[r]){busLayers[r]=L.layerGroup().addTo(map)}
|
||||||
if(!busMarkers[id]){busMarkers[id]=L.marker([0,0]).addTo(busLayers[r])}
|
if(!busMarkers[id]){busMarkers[id]=L.marker([0,0]).addTo(busLayers[r])}
|
||||||
if(!routes[r]){routes[r]=[0,0]}
|
if(!routes[r]){routes[r]=[0,0]}
|
||||||
|
@ -40,7 +37,7 @@ function updateMap(){
|
||||||
}
|
}
|
||||||
layerControl.remove();
|
layerControl.remove();
|
||||||
layerControl=L.control.layers(null,overlayLayers,{collapsed:window.innerWidth<window.innerHeight}).addTo(map);
|
layerControl=L.control.layers(null,overlayLayers,{collapsed:window.innerWidth<window.innerHeight}).addTo(map);
|
||||||
setTimeout(updateMap,6000)
|
setTimeout(updateMap,5000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
updateMap();
|
updateMap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue