From 4761996ba7b56b900366907a28442732955827c3 Mon Sep 17 00:00:00 2001 From: Simon Bjerre Date: Mon, 22 Apr 2024 13:26:34 +0200 Subject: [PATCH] work on stnads --- package-lock.json | 47 ++++++++++++++++++++++++++++++++++++++- package.json | 3 ++- src/components/NewMap.jsx | 14 +++++++----- src/pages/stands.astro | 13 +---------- tailwind.config.mjs | 2 +- 5 files changed, 58 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4125ef..0b61e45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,8 @@ "typescript": "^5.3.3" }, "devDependencies": { - "@types/react-simple-maps": "^3.0.4" + "@types/react-simple-maps": "^3.0.4", + "daisyui": "^4.10.2" } }, "node_modules/@alloc/quick-lru": { @@ -4952,6 +4953,16 @@ "node": ">= 8" } }, + "node_modules/css-selector-tokenizer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.8.0.tgz", + "integrity": "sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -4968,6 +4979,15 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/culori": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/culori/-/culori-3.3.0.tgz", + "integrity": "sha512-pHJg+jbuFsCjz9iclQBqyL3B2HLCBF71BwVNujUYEvCeQMvV97R59MNK3R2+jgJ3a1fcZgI9B3vYgz8lzr/BFQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/d3-array": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", @@ -5053,6 +5073,25 @@ "d3-transition": "2" } }, + "node_modules/daisyui": { + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.10.2.tgz", + "integrity": "sha512-eCWS1W/JPyxW9IvlgW5m0R6rp9ZhRsBTW37rvEUthckkjsV04u8XipV519OoccSA46ixhSJa3q7XLI1WUFtRCA==", + "dev": true, + "dependencies": { + "css-selector-tokenizer": "^0.8", + "culori": "^3", + "picocolors": "^1", + "postcss-js": "^4" + }, + "engines": { + "node": ">=16.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/daisyui" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -5403,6 +5442,12 @@ "node": ">=8.6.0" } }, + "node_modules/fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", + "dev": true + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", diff --git a/package.json b/package.json index dd27f48..fbac434 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "typescript": "^5.3.3" }, "devDependencies": { - "@types/react-simple-maps": "^3.0.4" + "@types/react-simple-maps": "^3.0.4", + "daisyui": "^4.10.2" } } diff --git a/src/components/NewMap.jsx b/src/components/NewMap.jsx index 6de5f1e..49105de 100644 --- a/src/components/NewMap.jsx +++ b/src/components/NewMap.jsx @@ -3,15 +3,14 @@ import * as maptilersdk from '@maptiler/sdk'; import "@maptiler/sdk/dist/maptiler-sdk.css"; import './map.css'; -export default function Map(airport) { + +export default function Map() { const mapContainer = useRef(null); var map = useRef(null); - var defaultAirport = { lng: 12.648131871581867, lat: 55.62513369975767}; - const [zoom] = useState(15); + var airport = { lng: 12.648131871581867, lat: 55.62513369975767, zoom: 15}; + var [zoom] = useState(airport.zoom); + maptilersdk.config.apiKey = 'YPWvjXSB1Key9mipDYw6'; - if(!airport) { - airport = defaultAirport - } useEffect(() => { if (map.current) return; // stops map from intializing more than once @@ -30,8 +29,11 @@ export default function Map(airport) { }, [airport.lng, airport.lat, zoom]); return ( + <> +
Denmark
+ ); } \ No newline at end of file diff --git a/src/pages/stands.astro b/src/pages/stands.astro index 4c99c2e..da70402 100644 --- a/src/pages/stands.astro +++ b/src/pages/stands.astro @@ -1,18 +1,7 @@ --- import Layout from "../layout/layout.astro"; -const EKBI = { lng: 9.148173216130179, lat: 55.741714236886445}; -const airport = EKBI; import Map from "../components/NewMap" --- -
- - -
- +
- diff --git a/tailwind.config.mjs b/tailwind.config.mjs index 9fdbb22..ecba4e1 100644 --- a/tailwind.config.mjs +++ b/tailwind.config.mjs @@ -16,5 +16,5 @@ export default { } }, darkMode: "class", - plugins: [nextui()] + plugins: [nextui(),require("daisyui")] }