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;