From b3fefb5e1a9383fb1fb1ecef1eb3fb921f4638ef Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Fri, 26 Jun 2020 16:45:05 -0500 Subject: [PATCH] Hotfix for image size (widgets) --- src/WPStrava/StaticMap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/WPStrava/StaticMap.php b/src/WPStrava/StaticMap.php index 3c12850..2b272ac 100644 --- a/src/WPStrava/StaticMap.php +++ b/src/WPStrava/StaticMap.php @@ -24,6 +24,11 @@ public static function get_image_tag( $activity, $height = 320, $width = 480, $m return ''; } + if ( ! $height || ! $width ) { + $height = 320; + $width = 480; + } + $url = "https://maps.googleapis.com/maps/api/staticmap?maptype=terrain&size={$width}x{$height}&scale=2&sensor=false&key={$key}&path=color:0xFF0000BF|weight:2|enc:"; $url_len = strlen( $url ); $max_chars = 1865;