X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b42939a3249e73027516eb6e79a9f1f8c642ff95..c125aab8dabf6716ae1164f0489bb9b41238c97f:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index a9fe9611..a932949d 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -148,9 +148,15 @@ $this->bBoundedSearch = (bool)$bBoundedSearch; } - function setViewBox($fLeft, $fBottom, $fRight, $fTop) + function setViewBox($sLeft, $sBottom, $sRight, $sTop) { - $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop); + $fLeft = (float)$sLeft; + $fRight = (float)$sRight; + $fTop = (float)$sTop; + $fBottom = (float)$sBottom; + if ($fRight > $fLeft && $fBottom < $fTop + && ($fRight - $fLeft) < 2 && ($fTop - $fBottom) < 2) + $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop); } function getViewBoxString()