Skip to content
Snippets Groups Projects
Commit 8bfcc194 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'revert-9c6248d2' into 'OO-Maps'

Revert "Tippfehler im DownloadController"

See merge request !1
parents 9c6248d2 daddb206
No related branches found
No related tags found
1 merge request!1Revert "Tippfehler im DownloadController"
/node_modules
/public/storage
/public/tile_cache
/public/tiles
/storage/*.key
/vendor
/.idea
......
......@@ -14,7 +14,7 @@ public function downloadArea($minx, $miny, $maxx, $maxy, $zoomstart, $zoomend){
$tmpdir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . getmypid() . ".zip";
// Create the temoporary Zip File that stores all the tiles
if($zip->open($tmpdir, file_exists($tmpdir) ? \ZipArchive::OVERWRITE : \ZipArchive::CREATE) == TRUE){
if($zip->open($tmpdir, file_exists($tmpdir) ? \ZipArchive::OVERWRITE : \ZipArchive::CREATE)){
for($zoom = $zoomstart; $zoom <= $zoomend; $zoom++){
// calculate the bbox for this Zoom
$xmintile = floor((($minx + 180) / 360) * pow(2, $zoom));
......@@ -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
for($x = $xmintile; $x <= $xmaxtile; $x++){
for($y = $ymintile; $y <= $ymaxtile; $y++){
$tile = public_path() . DIRECTORY_SEPARATOR . "tile_cache" . DIRECTORY_SEPARATOR . "$zoom" . DIRECTORY_SEPARATOR . "$x" . DIRECTORY_SEPARATOR . $y . ".png";
$tile = public_path() . DIRECTORY_SEPARATOR . "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)){
$zip->addFile($tile, $zipTile);
......
File mode changed from 100755 to 100644
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