replace caret with arrow img for heading

This commit is contained in:
steven 2025-05-18 16:07:23 -04:00
parent d104b16fc2
commit d98fd325df
2 changed files with 3 additions and 3 deletions

2
app.py
View file

@ -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('/<int:stop>')
@cache.cached(timeout=5)

View file

@ -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(`<b>Route ${r}</b><br>#${id} <span style="transform:rotate(${h}deg);display:inline-block;">^</span><br>${dir}<br>${dest}<br>${s}mph<br>${t}`)
busMarkers[id].setLatLng([lat,lng]).bindPopup(`<b>Route ${r}</b> (#${id})<br>${dest}<br><span style="transform:rotate(${h}deg);display:inline-block;"><img src="/static/fontawesome/svgs/solid/arrow-up.svg" width=16 height=16></span> ${s}mph<br>${dir}<br>${t}`)
})
let overlayLayers={};
for(let r in routes){