Skip to content

Commit 0129532

Browse files
Coordinates fix
1 parent 2c81dae commit 0129532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/api/offers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export default (req, res) => {
3131
const citiesKeys = Object.keys(citiesCoords);
3232
citiesKeys.forEach((cityName) => {
3333
const cityCoords = citiesCoords[cityName];
34-
const hasMatchingLat = latitude >= cityCoords.lat - 3 && latitude <= cityCoords.lat + 3;
35-
const hasMatchingLon = longitude >= cityCoords.lon - 3 && longitude <= cityCoords.lon + 3;
34+
const hasMatchingLat = latitude >= cityCoords.lat - 3 || latitude <= cityCoords.lat + 3;
35+
const hasMatchingLon = longitude >= cityCoords.lon - 3 || longitude <= cityCoords.lon + 3;
3636
if(hasMatchingLat && hasMatchingLon) {
3737
city = cityName;
3838
}

0 commit comments

Comments
 (0)