fix marker position on static maps
This commit is contained in:
13
inc/spot.php
13
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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user