mirror of
https://github.com/DerTyp7/apartment-altenau-nextjs.git
synced 2025-10-29 04:42:11 +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 }) {
|
||||
return (
|
||||
<div
|
||||
className="map"
|
||||
style={
|
||||
typeof window !== "undefined"
|
||||
? {
|
||||
width: width > window.innerWidth ?? "100%",
|
||||
height: height > window.innerHeight ?? "100%",
|
||||
}
|
||||
: {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}
|
||||
}
|
||||
>
|
||||
<div className="map" style={{ width: "100%", height: "100%" }}>
|
||||
<iframe
|
||||
id="googleMap"
|
||||
title="Google Maps"
|
||||
@@ -23,9 +10,7 @@ function Map({ width = "100%", height = "100%", showAddressText }) {
|
||||
style={{ border: "0" }}
|
||||
width={width}
|
||||
height={height}
|
||||
allowfullscreen="true"
|
||||
loading="lazy"
|
||||
referrerpolicy="no-referrer-when-downgrade"
|
||||
></iframe>
|
||||
{showAddressText ? (
|
||||
<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 {
|
||||
width: 90%;
|
||||
min-height: 500px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user