Browse Source

fix error handling when there is a problem downloading a tile

for #9
main
Aaron Parecki 2 years ago
parent
commit
5e271907b3
Failed to extract signature
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      p3k/geo/StaticMap.php

+ 4
- 6
p3k/geo/StaticMap.php View File

@ -352,9 +352,8 @@ function generate($params, $filename, $assetPath) {
foreach($chs as $x=>$yTiles) { foreach($chs as $x=>$yTiles) {
foreach($yTiles as $y=>$ch) { foreach($yTiles as $y=>$ch) {
$content = curl_multi_getcontent($ch); $content = curl_multi_getcontent($ch);
if($content)
$tiles[$x][$y] = @imagecreatefromstring($content);
else
$tiles[$x][$y] = @imagecreatefromstring($content);
if(!$tiles[$x][$y])
$tiles[$x][$y] = $blank; $tiles[$x][$y] = $blank;
} }
} }
@ -363,9 +362,8 @@ function generate($params, $filename, $assetPath) {
foreach($ochs as $x=>$yTiles) { foreach($ochs as $x=>$yTiles) {
foreach($yTiles as $y=>$ch) { foreach($yTiles as $y=>$ch) {
$content = curl_multi_getcontent($ch); $content = curl_multi_getcontent($ch);
if($content)
$overlays[$x][$y] = @imagecreatefromstring($content);
else
$overlays[$x][$y] = @imagecreatefromstring($content);
if(!$overlays[$x][$y])
$overlays[$x][$y] = $blank; $overlays[$x][$y] = $blank;
} }
} }

Loading…
Cancel
Save