mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
refactor: separate transit sources and request service
This commit is contained in:
1 parent
e284a9cd34
commit
3155e4e0bf
26 files changed
+1444
-1157
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import { fetchTransitHistory } from '../../data/transitProxy.js';
|
||||
import { getRegisteredTransitFeed } from '../../data/transitFeeds.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import {
|
||||
@@ -23,7 +22,7 @@ export const TRAIL_VERTEX_LIMIT = 2048;
|
||||
const STEP_M = 25;
|
||||
|
||||
/** Shared prepared paths. Floors are aligned to work with Google 3D tiles. */
|
||||
export function createTrails({ state, services, parts }) {
|
||||
export function createTrails({ state, services, parts, source }) {
|
||||
let historyRequest = null;
|
||||
let requestCount = 0,
|
||||
abortCount = 0;
|
||||
@@ -233,7 +232,10 @@ export function createTrails({ state, services, parts }) {
|
||||
const controller = new AbortController();
|
||||
historyRequest = controller;
|
||||
requestCount++;
|
||||
fetchTransitHistory(entry.feedId, entry.record.id, controller.signal)
|
||||
source
|
||||
.getHistory(entry.feedId, entry.record.id, {
|
||||
signal: controller.signal,
|
||||
})
|
||||
.then((payload) => {
|
||||
if (
|
||||
controller.signal.aborted ||
|
||||
|
||||
Reference in new issue
Block a user