From 3936d20020b412e866613aa5a39372fb6562082d Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 25 Apr 2024 14:59:40 +0200 Subject: [PATCH] maps add in maps --- front/src/components/Leaflet.astro | 55 ++++++++++++++++++++++++++++++ front/src/layouts/Layout.astro | 29 ---------------- front/src/pages/maps.astro | 27 +++++++++++---- 3 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 front/src/components/Leaflet.astro diff --git a/front/src/components/Leaflet.astro b/front/src/components/Leaflet.astro new file mode 100644 index 0000000..fb05b8a --- /dev/null +++ b/front/src/components/Leaflet.astro @@ -0,0 +1,55 @@ +--- +import type { string } from 'astro/zod' +import type { Marker } from 'leaflet' + +export interface Props { + latitude: number + longitude: number + zoom: number + /** the DOM ID of a
element */ + container: string + /** https://leafletjs.com/reference.html#tilelayer */ + tileLayer: string + /** Most tile servers require attribution. */ + attribution: string + containerstyle?: string +} + +const { latitude, longitude, zoom, container, tileLayer, attribution, containerstyle = "height: 61.8vh", class } = Astro.props +--- + + + +
+ + \ No newline at end of file diff --git a/front/src/layouts/Layout.astro b/front/src/layouts/Layout.astro index 7b552be..8ccef1b 100644 --- a/front/src/layouts/Layout.astro +++ b/front/src/layouts/Layout.astro @@ -20,32 +20,3 @@ const { title } = Astro.props; - diff --git a/front/src/pages/maps.astro b/front/src/pages/maps.astro index 1675880..095bae5 100644 --- a/front/src/pages/maps.astro +++ b/front/src/pages/maps.astro @@ -1,17 +1,32 @@ --- +import Leaflet from 'components/Leaflet.astro'; import Layout from 'layouts/Layout.astro'; -import { Marker, Popup } from 'leaflet'; -import { MapContainer } from 'react-leaflet' +// import { Marker, Popup } from 'leaflet'; +// import type { only } from 'node:test'; +// import { MapContainer, TileLayer } from 'react-leaflet' --- - - - + + +