Skip to content
Snippets Groups Projects
Commit 9c6248d2 authored by GitLab Runner's avatar GitLab Runner
Browse files

Tippfehler im DownloadController

parent bb82e430
No related branches found
No related tags found
Loading
/node_modules /node_modules
/public/storage /public/storage
/public/tiles /public/tile_cache
/storage/*.key /storage/*.key
/vendor /vendor
/.idea /.idea
......
...@@ -14,7 +14,7 @@ public function downloadArea($minx, $miny, $maxx, $maxy, $zoomstart, $zoomend){ ...@@ -14,7 +14,7 @@ public function downloadArea($minx, $miny, $maxx, $maxy, $zoomstart, $zoomend){
$tmpdir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . getmypid() . ".zip"; $tmpdir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . getmypid() . ".zip";
// Create the temoporary Zip File that stores all the tiles // Create the temoporary Zip File that stores all the tiles
if($zip->open($tmpdir, file_exists($tmpdir) ? \ZipArchive::OVERWRITE : \ZipArchive::CREATE)){ if($zip->open($tmpdir, file_exists($tmpdir) ? \ZipArchive::OVERWRITE : \ZipArchive::CREATE) == TRUE){
for($zoom = $zoomstart; $zoom <= $zoomend; $zoom++){ for($zoom = $zoomstart; $zoom <= $zoomend; $zoom++){
// calculate the bbox for this Zoom // calculate the bbox for this Zoom
$xmintile = floor((($minx + 180) / 360) * pow(2, $zoom)); $xmintile = floor((($minx + 180) / 360) * pow(2, $zoom));
...@@ -25,7 +25,7 @@ public function downloadArea($minx, $miny, $maxx, $maxy, $zoomstart, $zoomend){ ...@@ -25,7 +25,7 @@ public function downloadArea($minx, $miny, $maxx, $maxy, $zoomstart, $zoomend){
// We should've Prerendered all the requested Tiles and cann add them to the Zip archive // We should've Prerendered all the requested Tiles and cann add them to the Zip archive
for($x = $xmintile; $x <= $xmaxtile; $x++){ for($x = $xmintile; $x <= $xmaxtile; $x++){
for($y = $ymintile; $y <= $ymaxtile; $y++){ for($y = $ymintile; $y <= $ymaxtile; $y++){
$tile = public_path() . DIRECTORY_SEPARATOR . "tiles" . DIRECTORY_SEPARATOR . "$zoom" . DIRECTORY_SEPARATOR . "$x" . DIRECTORY_SEPARATOR . $y . ".png"; $tile = public_path() . DIRECTORY_SEPARATOR . "tile_cache" . DIRECTORY_SEPARATOR . "$zoom" . DIRECTORY_SEPARATOR . "$x" . DIRECTORY_SEPARATOR . $y . ".png";
$zipTile = "offline_tiles" . DIRECTORY_SEPARATOR . "$zoom" . DIRECTORY_SEPARATOR . "$x" . DIRECTORY_SEPARATOR . $y . ".png"; $zipTile = "offline_tiles" . DIRECTORY_SEPARATOR . "$zoom" . DIRECTORY_SEPARATOR . "$x" . DIRECTORY_SEPARATOR . $y . ".png";
if(file_exists($tile)){ if(file_exists($tile)){
$zip->addFile($tile, $zipTile); $zip->addFile($tile, $zipTile);
......
File mode changed from 100644 to 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment