From d0a73ba6a1ea039d2a6e2ca88663ea41cf19b0d3 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Thu, 27 Apr 2023 13:04:16 -0400 Subject: [PATCH] get all stations sooner --- lightning/src/components/map/MapScatLayer.tsx | 14 ++------------ lightning/src/root.tsx | 14 +++++++++++++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lightning/src/components/map/MapScatLayer.tsx b/lightning/src/components/map/MapScatLayer.tsx index c9986b3..6f37b0b 100644 --- a/lightning/src/components/map/MapScatLayer.tsx +++ b/lightning/src/components/map/MapScatLayer.tsx @@ -4,6 +4,7 @@ import { Layer } from 'solid-map-gl'; import type { JSX } from 'solid-js'; +import { allStations } from '~/root'; type ScatData = { @@ -12,23 +13,12 @@ type ScatData = { export default function MapScatLayer(props: any) { - - async function fetchAllStations() { - let buf: ScatData[] = []; - const response = await fetch('https://kevinfwu.com/getall'); - for (const station of await response.json()) { - buf.push({ coordinates: [station.Coordinates[1], station.Coordinates[0]] }) - }; - console.log('Rendering', buf.length, 'dots!'); - return (buf); - }; - return (