diff --git a/lizmap/modules/lizmap/classes/lizmapTiler.class.php b/lizmap/modules/lizmap/classes/lizmapTiler.class.php index a1e750a3de..80fc534266 100644 --- a/lizmap/modules/lizmap/classes/lizmapTiler.class.php +++ b/lizmap/modules/lizmap/classes/lizmapTiler.class.php @@ -219,9 +219,7 @@ public static function getTileMatrixSetList($project, $wms_xml) $rootExtent[3] = $geoExtent[3]; } - $scales = array_merge(array(), $project->getOption('mapScales')); - rsort($scales); - + $scales = self::normalizeProjectScales($project); $projection = $project->getOption('projection'); $tileMatrixSetList = array(); @@ -421,8 +419,7 @@ public static function getLayerTileInfo($layerName, $project, $wms_xml, $tileMat $rootExtent[3] = $geoExtent[3]; } - $scales = array_merge(array(), $project->getOption('mapScales')); - rsort($scales); + $scales = self::normalizeProjectScales($project); $layers = $project->getLayers(); $layer = $layers->{$layerName}; @@ -602,4 +599,15 @@ public static function getTileBbox($tileMatrixSet, $tileMatrixId, $tileRow, $til return (string) $minx.','.(string) $miny.','.(string) $maxx.','.(string) $maxy; } + + private static function normalizeProjectScales($project) + { + $scales = array_merge(array(), $project->getOption('mapScales')); + if (reset($scales) == 0) { + $scales[0] = 1; + } + rsort($scales); + + return $scales; + } }