From d98fd325dfffcdd8af23ba5966aeff3a980e909f Mon Sep 17 00:00:00 2001 From: steven Date: Sun, 18 May 2025 16:07:23 -0400 Subject: [PATCH] replace caret with arrow img for heading --- app.py | 2 +- templates/map.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 13cd4ce..96b737d 100644 --- a/app.py +++ b/app.py @@ -20,7 +20,7 @@ def index(): @cache.cached(timeout=5) def tarc(): d=httpx.get("https://tarc.rideralerts.com/InfoPoint/rest/Vehicles/GetAllVehiclesForRoutes?routeIDs=0,"+routes).json() - return "\n".join(f"{v['Latitude']},{v['Longitude']},{v['RouteId']},{v['Name']},{v['Heading']},{v['DirectionLong']},{v['Destination']},{v['Speed']},{v['LastUpdated'][6:16]}" for v in d) + return "\n".join(f"{v['Latitude']},{v['Longitude']},{v['RouteId']},{v['Name']},{v['Destination']},{v['Heading']},{v['Speed']},{v['DirectionLong']},{v['LastUpdated'][6:16]}" for v in d) @app.route('/') @cache.cached(timeout=5) diff --git a/templates/map.html b/templates/map.html index f8c492b..8de61ac 100644 --- a/templates/map.html +++ b/templates/map.html @@ -35,13 +35,13 @@ function updateMap(){ let routes={}; fetch("tarc.csv").then(response=>response.text()).then(csv=>{ csv.split("\n").forEach(line=>{ - let [lat,lng,r,id,h,dir,dest,s,t]=line.split(","); + let [lat,lng,r,id,dest,h,s,dir,t]=line.split(","); t=new Date(t*1000).toLocaleTimeString("en-US",{hour12:false}); if(!busLayers[r]){busLayers[r]=L.layerGroup().addTo(map)} if(!busMarkers[id]){busMarkers[id]=L.marker([0,0],{icon:busIcon}).on('click',()=>filterRoutes(r)).addTo(busLayers[r])} if(!routes[r]){routes[r]=0} routes[r]++; - busMarkers[id].setLatLng([lat,lng]).bindPopup(`Route ${r}
#${id} ^
${dir}
${dest}
${s}mph
${t}`) + busMarkers[id].setLatLng([lat,lng]).bindPopup(`Route ${r} (#${id})
${dest}
${s}mph
${dir}
${t}`) }) let overlayLayers={}; for(let r in routes){