type stuff
This commit is contained in:
parent
6f2ee27f35
commit
32f1917b41
1 changed files with 19 additions and 11 deletions
|
@ -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<Viewport>(options);
|
||||
|
||||
const [rotate, setRotate] = createSignal<boolean>(true)
|
||||
const toggleRotate = () => setRotate<boolean>(!rotate())
|
||||
|
||||
return (
|
||||
<MapGL
|
||||
mapLib={maplibre}
|
||||
options={{
|
||||
style: 'https://api.maptiler.com/maps/024da34e-fa66-4cb3-8f5f-0466b51e972e/style.json?key=Ukl2QNcQUCPAwuelQOvM'
|
||||
}}
|
||||
options={options}
|
||||
viewport={viewport()}
|
||||
onViewportChange={(evt: Viewport) => setViewport(evt)}
|
||||
>
|
||||
|
@ -52,3 +58,5 @@ export default function BadassMap(): Component {
|
|||
</MapGL>
|
||||
);
|
||||
};
|
||||
|
||||
export default BadassMap;
|
||||
|
|
Loading…
Add table
Reference in a new issue