]> Raphaël G. Git Repositories - packbundle/commitdiff
Use hash instead of coordinate chain to generate map cache filename not too long...
authorRaphaël Gertz <git@rapsys.eu>
Wed, 2 Dec 2026 23:11:39 +0000 (00:11 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 2 Dec 2026 23:11:39 +0000 (00:11 +0100)
Controller.php

index 7728f2e4410327d74bd97cdb1537d7e88dd57deb..dd94a6f359764b1385766f5ffedb2cb5770bb552 100644 (file)
@@ -556,7 +556,8 @@ class Controller extends AbstractController implements ServiceSubscriberInterfac
                $longitude = round((min($longitudes)+max($longitudes))/2, 6);
 
                //Set map
-               $map = $this->config['cache'].'/'.$this->config['prefixes']['multi'].'/'.$zoom.'/'.($latitude*1000000%10).'/'.($longitude*1000000%10).'/'.$coordinate.'-'.$zoom.'-'.$width.'x'.$height.'.'.$_format;
+               //XXX: use hash with number of coordinates instead of coordinate value, filename over 255 characters isn't supported on many systems
+               $map = $this->config['cache'].'/'.$this->config['prefixes']['multi'].'/'.$zoom.'/'.($latitude*1000000%10).'/'.($longitude*1000000%10).'/'.$hash.'-'.count($coordinates).'-'.$zoom.'-'.$width.'x'.$height.'.'.$_format;
 
                //Without map file
                if (!is_file($map)) {