Merged in fix/SW-1014-city-not-found-on-map (pull request #973)

fix(SW-1014): Fixed issue where google didn't found city.

Approved-by: Niclas Edenvin
This commit is contained in:
Pontus Dreij
2024-11-25 15:05:34 +00:00
7 changed files with 50 additions and 9 deletions

View File

@@ -58,7 +58,10 @@ export default async function SelectHotelMapPage({
const hotelPins = getHotelPins(hotels)
const filterList = getFiltersFromHotels(hotels)
const cityCoordinates = await getCityCoordinates({ city: city.name })
const cityCoordinates = await getCityCoordinates({
city: city.name,
hotel: { address: hotels[0].hotelData.address.streetAddress },
})
return (
<MapModal>

View File

@@ -51,8 +51,12 @@ export default async function SelectHotelPage({
(location) =>
location.name.toLowerCase() === searchParams.city.toLowerCase()
)
if (!city) return notFound()
const isCityWithCountry = (city: any): city is { country: string } =>
"country" in city
const intl = await getIntl()
const selectHotelParams = new URLSearchParams(searchParams)
const selectHotelParamsObject =
@@ -124,6 +128,7 @@ export default async function SelectHotelPage({
<div className={styles.mapContainer}>
<StaticMap
city={searchParams.city}
country={isCityWithCountry(city) ? city.country : undefined}
width={340}
height={180}
zoomLevel={11}