diff options
author | Aaron Parecki <aaron@parecki.com> | 2022-06-04 13:23:28 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2022-06-04 13:23:28 -0700 |
commit | b3b3dc41bce85850bf60347bdaec954390b674df (patch) | |
tree | b0ba566467ece4ccb087f99e545e4799c816a079 /lib | |
parent | 30f62de1816439ba5920abfbede0721d568b8962 (diff) |
switch to local rendering of static map
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config.template.php | 2 | ||||
-rw-r--r-- | lib/helpers.php | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/config.template.php b/lib/config.template.php index 4d168b2..0aea57c 100644 --- a/lib/config.template.php +++ b/lib/config.template.php @@ -20,6 +20,8 @@ class Config { public static $twitterClientID = ''; public static $twitterClientSecret = ''; + public static $mapTileURL = ''; + // https://developers.google.com/maps/documentation/javascript/get-api-key public static $googleMapsAPIKey = ''; } diff --git a/lib/helpers.php b/lib/helpers.php index ec23afa..5408906 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -370,7 +370,14 @@ function get_micropub_source(&$user, $url, $properties) { } function static_map($latitude, $longitude, $height=180, $width=700, $zoom=14) { - return 'https://atlas.p3k.io/map/img?marker[]=lat:' . $latitude . ';lng:' . $longitude . ';icon:small-blue-cutout&basemap=gray&width=' . $width . '&height=' . $height . '&zoom=' . $zoom; + $params = [ + 'lat' => $latitude, + 'lng' => $longitude, + 'h' => $height, + 'w' => $width, + 'z' => $zoom, + ]; + return '/map-img?'.http_build_query($params); } function relative_time($date) { |