From f9613843762c1c17249a38b743c723cd05a939ae Mon Sep 17 00:00:00 2001 From: franzz Date: Wed, 6 Feb 2019 22:23:06 +0100 Subject: [PATCH] fix marker position on static maps --- inc/spot.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inc/spot.php b/inc/spot.php index 063e7bc..00c1977 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -132,7 +132,9 @@ class Spot extends Main 'projects' => $this->oProject->getProjects() ), 'consts' => array( - 'modes' => Project::MODES + 'modes' => Project::MODES, + 'site_timezone' => Settings::TIMEZONE, + 'site_timezone_desc' => self::getTimeZoneDesc(Settings::TIMEZONE) ) ), 'index', @@ -414,7 +416,7 @@ class Spot extends Main { if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == $this->asContext['serv_name']) { $asDomains = array(); - $sReferer = 'http://spot.lutran.fr'; + $sReferer = 'https://spot.lutran.fr'; switch($sMapId) { case 'mapbox.satellite': case 'mapbox.streets': @@ -435,7 +437,7 @@ class Spot extends Main $sReferer = 'https://www.visugpx.com/yfJDwfuTlf'; break; case 'static': - $sPattern = 'https://api.mapbox.com/v4/mapbox.satellite/url-http%3A%2F%2Fspot.lutran.fr%2Fimages%2Ffootprint.png({x},{y})/{x},{y},{z}/400x300.png?access_token={token}'; + $sPattern = 'https://api.mapbox.com/v4/mapbox.satellite/url-https%3A%2F%2Fspot.lutran.fr%2Fimages%2Ffootprint_mapbox.png({x},{y})/{x},{y},{z}/400x300.png?access_token={token}'; $sToken = Settings::MAPBOX_KEY; break; } @@ -471,6 +473,11 @@ class Spot extends Main return $iDegree.'°'.$iMinute.'\''.$fSecond.'"'.$sDirection; } + + public static function getTimeZoneDesc($sTimeZone) { + $sCity = substr(strrchr($sTimeZone, '/'), 1); + return 'heure d'.(in_array(strtolower(substr($sCity, 0, 1)), array('a', 'e', 'i', 'o', 'u', 'h'))?'\'':'e ').$sCity; + } } ?> \ No newline at end of file