Browse Source

fix map

dependabot/composer/firebase/php-jwt-6.0.0
Aaron Parecki 2 years ago
parent
commit
86fb4a5ce7
Failed to extract signature
2 changed files with 2 additions and 3 deletions
  1. +1
    -0
      controllers/controllers.php
  2. +1
    -3
      lib/helpers.php

+ 1
- 0
controllers/controllers.php View File

@ -911,6 +911,7 @@ $app->get('/map-img', function() use($app) {
'width' => $params['w'], 'width' => $params['w'],
'height' => $params['h'], 'height' => $params['h'],
'zoom' => $params['z'], 'zoom' => $params['z'],
'attribution' => 'mapbox',
'tileurl' => Config::$mapTileURL, 'tileurl' => Config::$mapTileURL,
'token' => Config::$atlasToken, 'token' => Config::$atlasToken,
]; ];

+ 1
- 3
lib/helpers.php View File

@ -371,13 +371,11 @@ function get_micropub_source(&$user, $url, $properties) {
function static_map($latitude, $longitude, $height=180, $width=700, $zoom=14) { function static_map($latitude, $longitude, $height=180, $width=700, $zoom=14) {
$params = [ $params = [
'lat' => $latitude,
'lng' => $longitude,
'h' => $height, 'h' => $height,
'w' => $width, 'w' => $width,
'z' => $zoom, 'z' => $zoom,
]; ];
return '/map-img?'.http_build_query($params);
return '/map-img?lat='.$latitude.'&lng='.$longitude.'&'.http_build_query($params);
} }
function relative_time($date) { function relative_time($date) {

Loading…
Cancel
Save