From d82fb3b552d20a279efdd9408042183cfa02fb48 Mon Sep 17 00:00:00 2001 From: schererleander Date: Thu, 25 Dec 2025 23:33:25 +0000 Subject: initial commit --- components/map.tsx | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 components/map.tsx (limited to 'components/map.tsx') diff --git a/components/map.tsx b/components/map.tsx new file mode 100644 index 0000000..8584c76 --- /dev/null +++ b/components/map.tsx @@ -0,0 +1,70 @@ + +"use client" + +import { useRef } from 'react'; +import MapGL, { Marker, MapRef } from 'react-map-gl/maplibre'; +import maplibregl from 'maplibre-gl'; +import 'maplibre-gl/dist/maplibre-gl.css'; + +const KARLSRUHE: { longitude: number, latitude: number } = { longitude: 8.4037, latitude: 49.0069 }; + +export default function Map() { + const mapRef = useRef(null); + + const onMapLoad = () => { + mapRef.current?.flyTo({ + center: [KARLSRUHE.longitude, KARLSRUHE.latitude], + zoom: 10, + speed: 0.5, + curve: 1, + essential: true + }); + }; + + return ( +
+ OpenStreetMap, © CARTO', + }, + }, + layers: [ + { + id: "carto-dark-layer", + type: "raster", + source: "carto-dark", + minzoom: 0, + maxzoom: 22, + }, + ], + }} + attributionControl={false} + > + +
+ + +
+ ); +} -- cgit v1.3.1