mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
refactor: separate map feature queries and source records
This commit is contained in:
1 parent
a8125ad917
commit
bf1d50f29b
28 files changed
+1128
-675
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { normalizeOverpassRoads } from '../../sources/overpassRoads.js';
|
||||
export { normalizeOverpassRoads } from '../../sources/overpassRoads.js';
|
||||
import { createFlowTileSource } from './flowSource.js';
|
||||
function buildOverpassQuery(
|
||||
south,
|
||||
@@ -58,7 +60,9 @@ export function createTrafficSource({
|
||||
async json() {
|
||||
const body = await response.json();
|
||||
signal?.throwIfAborted();
|
||||
return body;
|
||||
if (!Array.isArray(body?.elements))
|
||||
throw new Error('Malformed road snapshot');
|
||||
return { roads: normalizeOverpassRoads(body) };
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user