]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
make number of polygon outputs allowed a constant
[nominatim.git] / website / search.php
index e2ef1d3ca49f0a00743b3bbd8875c86938fb6972..69f6a666d0bcdbfcf9f80465d5760325291288bb 100755 (executable)
        $bAsKML = (boolean)isset($_GET['polygon_kml']) && $_GET['polygon_kml'];
        $bAsSVG = (boolean)isset($_GET['polygon_svg']) && $_GET['polygon_svg'];
        $bAsText = (boolean)isset($_GET['polygon_text']) && $_GET['polygon_text'];
        $bAsKML = (boolean)isset($_GET['polygon_kml']) && $_GET['polygon_kml'];
        $bAsSVG = (boolean)isset($_GET['polygon_svg']) && $_GET['polygon_svg'];
        $bAsText = (boolean)isset($_GET['polygon_text']) && $_GET['polygon_text'];
+       if ((($bShowPolygons?1:0)  
+          + ($bAsGeoJSON?1:0) 
+          + ($bAsKML?1:0) 
+          + ($bAsSVG?1:0) 
+          + ($bAsTEXT?1:0) 
+               ) > CONST_PolygonOutput_MaximumTypes) {
+               if (CONST_PolygonOutput_MaximumTypes) {
+                       echo "Select only ".CONST_PolygonOutput_MaximumTypes." polgyon output option";
+               } else {
+                       echo "Polygon output is disabled";
+               }
+               exit;
+       }
 
        // Show address breakdown
        $bShowAddressDetails = isset($_GET['addressdetails']) && $_GET['addressdetails'];
 
        // Show address breakdown
        $bShowAddressDetails = isset($_GET['addressdetails']) && $_GET['addressdetails'];