]> git.openstreetmap.org Git - nominatim.git/commitdiff
Don't add viewbox weight when no viewbox is given
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 20 Jul 2018 21:29:36 +0000 (23:29 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 20 Jul 2018 21:29:36 +0000 (23:29 +0200)
Fixes #1068.

lib/Geocode.php

index b9e26f0381dc9aef3055ebcdc28a8ffd15b637df..f0e03de5f3e75c1b8e4b81ba458963c94b8828b9 100644 (file)
@@ -149,6 +149,10 @@ class Geocode
 
     private function viewboxImportanceFactor($fX, $fY)
     {
+        if (!$this->aViewBox) {
+            return 1;
+        }
+
         $fWidth = ($this->aViewBox[2] - $this->aViewBox[0])/2;
         $fHeight = ($this->aViewBox[3] - $this->aViewBox[1])/2;