From 6c71a67a7473ee30c424ac63b4d2b27c38007d5e Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 17:04:21 +0300 Subject: Add map --- src/components/widgets/Map.astro | 60 ++++++++++++++++++++++++++++++++++++++++ src/pages/index.astro | 11 ++++++++ src/types.d.ts | 7 +++++ 3 files changed, 78 insertions(+) create mode 100644 src/components/widgets/Map.astro diff --git a/src/components/widgets/Map.astro b/src/components/widgets/Map.astro new file mode 100644 index 0000000..dae8253 --- /dev/null +++ b/src/components/widgets/Map.astro @@ -0,0 +1,60 @@ +--- +import type { Map as Props } from '~/types'; +import Headline from '~/components/ui/Headline.astro'; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; + +const { + title = '', + subtitle = '', + tagline = '', + location = '', + height = 400, + lat = 53.1234, + lon = 18.0123, + + id, + isDark = false, + classes = {}, + bg = await Astro.slots.render('bg'), +} = Astro.props; + +// Use provided coordinates or default to Bydgoszcz, Miedzyń +const coordinates = { + lat: lat, + lon: lon +}; + +// Create map URL with proper coordinates +const mapUrl = `https://www.openstreetmap.org/export/embed.html?bbox=${coordinates.lon-0.01},${coordinates.lat-0.01},${coordinates.lon+0.01},${coordinates.lat+0.01}&layer=mapnik&marker=${coordinates.lat},${coordinates.lon}`; +--- + + + + + + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 7b5ae89..df14280 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -14,6 +14,7 @@ import CallToAction from '~/components/widgets/CallToAction.astro'; import CallToActionImage from '~/components/widgets/CallToActionImage.astro'; import Pricing from '~/components/widgets/Pricing.astro'; import Portfolio from '~/components/widgets/Portfolio.astro'; +import Map from '~/components/widgets/Map.astro'; const metadata = { title: 'CustomWorks – Detailing, wrapping, tuning | Profesjonalne usługi pielęgnacji samochodów – Bydgoszcz', @@ -279,6 +280,16 @@ const metadata = { ]} /> + + + + , Widget { callToAction?: CallToAction; } +export interface Map extends Omit, Widget { + location?: string; + height?: number; + lat?: number; + lon?: number; +} + export interface Contact extends Omit, Form, Widget {} -- cgit v1.2.3