feat(sw-343): fixed map page (without modal)
This commit is contained in:
@@ -78,3 +78,19 @@ export function getPointOfInterests(hotels: HotelData[]): PointOfInterest[] {
|
||||
group: PointOfInterestGroupEnum.LOCATION,
|
||||
}))
|
||||
}
|
||||
|
||||
export function getCentralCoordinates(pointOfInterests: PointOfInterest[]) {
|
||||
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
|
||||
|
||||
return centralCoordinates
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user