From 6017f9f36a4b204d6f92a963832d3a3d17ea2f02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 3 Dec 2026 00:11:39 +0100 Subject: [PATCH] Use hash instead of coordinate chain to generate map cache filename not too long for underlying filesystem --- Controller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller.php b/Controller.php index 7728f2e..dd94a6f 100644 --- a/Controller.php +++ b/Controller.php @@ -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)) { -- 2.52.1