From 32f1917b414d3f954f67247621b7ede75a04747c Mon Sep 17 00:00:00 2001 From: Adam <24621027+WhiteDopeOnPunk@users.noreply.github.com> Date: Sat, 15 Apr 2023 07:59:50 -0400 Subject: [PATCH] type stuff --- lightning/src/components/BadassMap.tsx | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lightning/src/components/BadassMap.tsx b/lightning/src/components/BadassMap.tsx index 04ff186..3db1f07 100644 --- a/lightning/src/components/BadassMap.tsx +++ b/lightning/src/components/BadassMap.tsx @@ -1,27 +1,33 @@ -import { Component, createSignal, Show } from 'solid-js'; +import { createSignal, Show } from 'solid-js'; import MapGL, { Viewport, Control, Light, Camera } from 'solid-map-gl'; import * as maplibre from 'maplibre-gl'; + +import type { JSX } from 'solid-js'; +import type { MapOptions } from 'maplibre-gl'; + import 'maplibre-gl/dist/maplibre-gl.css'; -export default function BadassMap(): Component { - const [viewport, setViewport] = createSignal({ +function BadassMap(): JSX.Element { + const options: MapOptions = { + container: '', + style: 'https://api.maptiler.com/maps/024da34e-fa66-4cb3-8f5f-0466b51e972e/style.json?key=Ukl2QNcQUCPAwuelQOvM', + maxPitch: 85, + antialias: true, center: [-71.05625, 42.36], zoom: 15.5, bearing: 160, pitch: 60, - maxPitch: 85, - antialias: true, - } as Viewport); + } - const [rotate, setRotate] = createSignal(true) - const toggleRotate = () => setRotate(!rotate()) + const [viewport, setViewport] = createSignal(options); + + const [rotate, setRotate] = createSignal(true) + const toggleRotate = () => setRotate(!rotate()) return ( setViewport(evt)} > @@ -52,3 +58,5 @@ export default function BadassMap(): Component { ); }; + +export default BadassMap;