[ka-Map-users] Another bug fix for precache2.php

Stephen Woodbridge woodbri at swoodbridge.com
Fri Aug 18 15:22:25 EDT 2006

In the block of code below you need to change the if statement to be:

         if(!file_exists($szTileImg) || $bForce) {

Otherwise it will not re-generate the files if Force is set and the tile 
already exists.

// draw individual tiles
for($i = 0; $i < $metaWidth; ++$i) {
     for($j = 0; $j < $metaHeight; ++$j) {
         $tileTop = ($j * $tileHeight) + $metaBuffer;
         $tileLeft = ($i * $tileWidth) + $metaBuffer;
         $szTileImg = $szCacheDir . "/t" . ($metaTop + $tileTop) . "l" . 
($metaLeft + $tileLeft) . $szImageExtension;
         if(!file_exists($szTileImg) || $bForce) {
             eval("\$oTile = ".$szImageCreateFunction."( 
".$tileWidth.",".$tileHeight." );");

Also, as an optimization, the loop that checks if all the files exist 
for a given metatile should be skipped over if bForce is true because we 
are going to draw it anyway so why waste a lot of time checking for 
files when we don't care!


More information about the ka-Map-users mailing list