use custom iframes

This commit is contained in:
steven 2025-05-11 00:01:05 -04:00
parent b8cb9881b3
commit 4025bc115b
3 changed files with 35 additions and 4 deletions

View file

@ -9,15 +9,15 @@
<script src="/static/leaflet/leaflet.js"></script>
<link rel="stylesheet" href="/static/leaflet/leaflet.css">
<base target="_blank">
<style>html,body{height:100%;margin:0;}#map{height:100vh;}iframe{border:none;}</style>
<style>html,body{height:100%;margin:0;}#map{height:100vh;}iframe{border:none;width:400px;}.leaflet-popup-content{min-width:400px}</style>
</head>
<body>
<div id="map"></div>
<script>
let map=L.map("map",{center:[38.22,-85.7],zoom:12,layers:[L.tileLayer("https://tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey=cf957cde4a7b40bbb49479c8fa4d60f7")]});
let stops={{stops}};
let stops={{stops|safe}};
for (stop in stops){
L.circle(stops[stop]).bindPopup(`<iframe src="https://tarc.rideralerts.com/InfoPoint/Minimal/Departures/ForStop?stopId=${stop}">Stop #${stop}</iframe>`).addTo(map)
L.circle(stops[stop][0]).bindPopup(`${stops[stop][1]} (#${stop})<iframe src="${stop}"></iframe>`).addTo(map)
}
let busIcon=L.icon({iconUrl:'static/bus.ico',iconSize:[32,32]})
let layerControl=L.control.layers().addTo(map);

10
templates/stop.html Normal file
View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>html,body{margin:0;font-size:12px}</style>
</head>
<body>
{{table|safe}}
</body>
</html>