diff --git a/inc/spot.php b/inc/spot.php index 793873b..d041c45 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -412,6 +412,10 @@ class Spot extends Main $sToken = Settings::IGN_FR_KEY; $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}'; + $sToken = Settings::MAPBOX_KEY; + break; } $oCacher = new Cacher($sPattern, $sMapId); $oCacher->setToken($sToken); diff --git a/masks/project.html b/masks/project.html index 06dc5da..257b49b 100755 --- a/masks/project.html +++ b/masks/project.html @@ -414,13 +414,12 @@ function getPost(asPost) { } function getStaticMapUrl(oCenterLat, oCenterLng) { - var asParams = [ - 'https://api.mapbox.com/v4/mapbox.satellite', //Domain - 'url-http%3A%2F%2Fspot.lutran.fr%2Fimages%2Ffootprint.png('+oCenterLng+','+oCenterLat+')', //Marker - oCenterLng+','+oCenterLat+',13', //Center + zoom - '400x300.png?access_token='+self.vars('mapbox_key') //Image size + access token - ]; - - return asParams.join('/'); + return '?'+$.param({ + 'a': 'tile', + 'id': 'static', + 'z': 13, + 'x': oCenterLng, + 'y': oCenterLat + }); } \ No newline at end of file diff --git a/todo b/todo index aab0c2a..52db2fa 100644 --- a/todo +++ b/todo @@ -2,7 +2,6 @@ To Do List ---------- - Elevation chart - Table for images -- Static maps in backend - Device/Spot Class - Manage projects.timezone - Remove files2/ on server