From e1b2d5da942794edf7ed2d8d2622bce6bbb5c686 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Thu, 27 Apr 2023 12:16:08 -0400 Subject: [PATCH] add test tools --- lightning/src/components/Toolbox.tsx | 95 +++++++++++++++++-- lightning/src/components/map/BadassMap.tsx | 11 ++- lightning/src/components/map/MapScatLayer.tsx | 5 +- lightning/src/routes/stations.tsx | 4 +- 4 files changed, 103 insertions(+), 12 deletions(-) diff --git a/lightning/src/components/Toolbox.tsx b/lightning/src/components/Toolbox.tsx index c142a48..0d3a112 100644 --- a/lightning/src/components/Toolbox.tsx +++ b/lightning/src/components/Toolbox.tsx @@ -1,5 +1,6 @@ import type { JSX } from "solid-js" import type { Viewport } from "solid-map-gl"; +import { mapRotate, setMapRotate } from "./map/BadassMap"; import { useMapContext } from "./MapContext"; @@ -9,16 +10,37 @@ export function Toolbox() { ) as JSX.Element; }; diff --git a/lightning/src/components/map/BadassMap.tsx b/lightning/src/components/map/BadassMap.tsx index f892f56..967dd96 100644 --- a/lightning/src/components/map/BadassMap.tsx +++ b/lightning/src/components/map/BadassMap.tsx @@ -1,10 +1,10 @@ -import MapGL, { Viewport } from 'solid-map-gl'; +import MapGL, { Camera, Viewport } from 'solid-map-gl'; import * as maplibre from 'maplibre-gl'; import MapControls from './MapControls'; import MapMarkerLayer from './MapMarkerLayer.tsx'; import type { MapOptions } from 'maplibre-gl'; -import type { JSX } from 'solid-js'; +import { createEffect, createSignal, JSX } from 'solid-js'; // deck.gl import { unstable_clientOnly } from 'solid-start'; @@ -16,6 +16,9 @@ import StyleJson from '~/style/style.json'; import { useMapContext } from '../MapContext'; +export const [mapRotate, setMapRotate] = createSignal(false); + +createEffect(() => console.log(mapRotate())); export default function BadassMap(props: any) { const [viewport, { setViewport }] = useMapContext(); @@ -35,6 +38,10 @@ export default function BadassMap(props: any) { transitionType="flyTo" > + diff --git a/lightning/src/components/map/MapScatLayer.tsx b/lightning/src/components/map/MapScatLayer.tsx index 390e4b4..c9986b3 100644 --- a/lightning/src/components/map/MapScatLayer.tsx +++ b/lightning/src/components/map/MapScatLayer.tsx @@ -19,6 +19,7 @@ export default function MapScatLayer(props: any) { for (const station of await response.json()) { buf.push({ coordinates: [station.Coordinates[1], station.Coordinates[0]] }) }; + console.log('Rendering', buf.length, 'dots!'); return (buf); }; @@ -28,11 +29,11 @@ export default function MapScatLayer(props: any) { id: 'deckgl-scatterplot', type: ScatterplotLayer, data: fetchAllStations(), - pickable: true, + pickable: false, stroked: false, lineWidthMaxPixels: 0, radiusMinPixels: 1, - radiusMaxPixels: 100, + radiusMaxPixels: 50, radiusUnits: 'meters', getRadius: 1, radiusScale: 10, diff --git a/lightning/src/routes/stations.tsx b/lightning/src/routes/stations.tsx index 7f76d6a..c778f49 100644 --- a/lightning/src/routes/stations.tsx +++ b/lightning/src/routes/stations.tsx @@ -9,8 +9,8 @@ import { useStationsContext } from '~/components/StationsContext'; const TEST_PACKET: StationRequest = { Latitude: 42.36, Longitude: -71.05625, - Distance: 1000, - CountLimit: 20000, + Distance: 10, + CountLimit: 200, }; export default function Stations() {