From c125aab8dabf6716ae1164f0489bb9b41238c97f Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 12 Jun 2015 23:53:40 +0200 Subject: [PATCH] fix top-bottom mixup in bounding box --- lib/Geocode.php | 4 ++-- tests/features/api/regression.feature | 2 +- tests/features/api/search_params.feature | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Geocode.php b/lib/Geocode.php index a9fa44fe..a932949d 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -154,8 +154,8 @@ $fRight = (float)$sRight; $fTop = (float)$sTop; $fBottom = (float)$sBottom; - if ($fRight > $fLeft && $fBottom > $fTop - && ($fRight - $fLeft) < 2 && ($fBottom - $fTop) < 2) + if ($fRight > $fLeft && $fBottom < $fTop + && ($fRight - $fLeft) < 2 && ($fTop - $fBottom) < 2) $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop); } diff --git a/tests/features/api/regression.feature b/tests/features/api/regression.feature index 8a436fc3..bbff268a 100644 --- a/tests/features/api/regression.feature +++ b/tests/features/api/regression.feature @@ -187,7 +187,7 @@ Feature: API regression tests Scenario: trac #5238 Given the request parameters | bounded | viewbox - | 1 | 0,0,-1,-1 + | 1 | 0,0,1,-1 When sending json search query "sy" Then exactly 0 results are returned diff --git a/tests/features/api/search_params.feature b/tests/features/api/search_params.feature index b9d06791..92ca8c39 100644 --- a/tests/features/api/search_params.feature +++ b/tests/features/api/search_params.feature @@ -83,7 +83,7 @@ Feature: Search queries Scenario: bounded search remains within viewbox, even with no results Given the request parameters | bounded | viewbox - | 1 | 43.54285,-5.662003,43.5403125,-5.6563282 + | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 When sending json search query "restaurant" Then less than 1 result is returned -- 2.39.5