feat(sw-343): fixed map page (without modal)
This commit is contained in:
@@ -11,6 +11,7 @@ import { setLang } from "@/i18n/serverContext"
|
||||
import {
|
||||
fetchAvailableHotels,
|
||||
generateChildrenString,
|
||||
getCentralCoordinates,
|
||||
getPointOfInterests,
|
||||
} from "../../utils"
|
||||
|
||||
@@ -54,17 +55,7 @@ export default async function SelectHotelMapPage({
|
||||
|
||||
const pointOfInterests = getPointOfInterests(hotels)
|
||||
|
||||
const centralCoordinates = pointOfInterests.reduce(
|
||||
(acc, poi) => {
|
||||
acc.lat += poi.coordinates.lat
|
||||
acc.lng += poi.coordinates.lng
|
||||
return acc
|
||||
},
|
||||
{ lat: 0, lng: 0 }
|
||||
)
|
||||
|
||||
centralCoordinates.lat /= pointOfInterests.length
|
||||
centralCoordinates.lng /= pointOfInterests.length
|
||||
const centralCoordinates = getCentralCoordinates(pointOfInterests)
|
||||
|
||||
return (
|
||||
<MapModal>
|
||||
@@ -73,6 +64,7 @@ export default async function SelectHotelMapPage({
|
||||
coordinates={centralCoordinates}
|
||||
pointsOfInterest={pointOfInterests}
|
||||
mapId={googleMapId}
|
||||
isModal={true}
|
||||
/>
|
||||
</MapModal>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user