diff --git a/transport_accessibility/pt_map/templates/map.html b/transport_accessibility/pt_map/templates/map.html index e361fba..502cdf4 100644 --- a/transport_accessibility/pt_map/templates/map.html +++ b/transport_accessibility/pt_map/templates/map.html @@ -177,7 +177,9 @@ } function importGTFS() { - imported_data = JSON.parse('{{ data }}'); + stops = JSON.parse('{{ stops|safe }}'); + routes = JSON.parse('{{ routes|safe }}') + timetable = JSON.parse('{{ timetable|safe }}') alert("Import existing GTFS clicked"); // Logic to import existing GTFS would go here } diff --git a/transport_accessibility/pt_map/views.py b/transport_accessibility/pt_map/views.py index 5936db7..9098f47 100644 --- a/transport_accessibility/pt_map/views.py +++ b/transport_accessibility/pt_map/views.py @@ -52,6 +52,6 @@ def index(request): timetable = get_timetable(r, trips, stop_sequences) except Route.DoesNotExist: print(f"Invalid request for Route with id {request.GET['timetable']}") - context = {"data": json.dumps({"stops": stops, "routes": routes, "timetable": timetable})} + context = {"stops": json.dumps(stops), "routes": json.dumps(routes), "timetable": json.dumps(timetable)} return render(request,"map.html", context)