mirror of
https://github.com/DerTyp7/apartment-altenau-nextjs.git
synced 2025-10-29 12:52:12 +01:00
[fix] map freezes on mobile view
This commit is contained in:
@@ -2,20 +2,7 @@ import "../styles/Map.module.scss";
|
|||||||
|
|
||||||
function Map({ width = "100%", height = "100%", showAddressText }) {
|
function Map({ width = "100%", height = "100%", showAddressText }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="map" style={{ width: "100%", height: "100%" }}>
|
||||||
className="map"
|
|
||||||
style={
|
|
||||||
typeof window !== "undefined"
|
|
||||||
? {
|
|
||||||
width: width > window.innerWidth ?? "100%",
|
|
||||||
height: height > window.innerHeight ?? "100%",
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<iframe
|
<iframe
|
||||||
id="googleMap"
|
id="googleMap"
|
||||||
title="Google Maps"
|
title="Google Maps"
|
||||||
@@ -23,9 +10,7 @@ function Map({ width = "100%", height = "100%", showAddressText }) {
|
|||||||
style={{ border: "0" }}
|
style={{ border: "0" }}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
allowfullscreen="true"
|
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
referrerpolicy="no-referrer-when-downgrade"
|
|
||||||
></iframe>
|
></iframe>
|
||||||
{showAddressText ? (
|
{showAddressText ? (
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
||||||
|
|
||||||
export default function handler(req, res) {
|
|
||||||
res.status(200).json({ name: 'John Doe' })
|
|
||||||
}
|
|
||||||
@@ -117,6 +117,7 @@
|
|||||||
|
|
||||||
.homeMapContainer {
|
.homeMapContainer {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
min-height: 500px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user