Skip to content

Commit

Permalink
refactor: reduce default zoom level
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Dec 2, 2023
1 parent ceec060 commit d23f06b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/MapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function getStaticImage(Map $map)
// Set default values if they are not set
$validatedData['width'] = $validatedData['width'] ?? 600;
$validatedData['height'] = $validatedData['height'] ?? 400;
$validatedData['zoom'] = $validatedData['zoom'] ?? 10;
$validatedData['zoom'] = $validatedData['zoom'] ?? 5;
$validatedData['responseType'] = $validatedData['responseType'] ?? 'png';

// If the responseType is base64, we need to return a base64 encoded string
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function getBlacklistedParameters(): array
* @param string $output
* @return string
*/
public function generateStaticMapImage(int $width = 600, int $height = 400, int $zoom = 10, string $output = 'base64')
public function generateStaticMapImage(int $width = 600, int $height = 400, int $zoom = 5, string $output = 'base64')
{

// We will use the dantsu/php-osm-static-api package to generate the static map image
Expand Down Expand Up @@ -343,7 +343,7 @@ public function generateStaticMapImage(int $width = 600, int $height = 400, int
return $image;
}

public function getStaticMapImageCacheKey($width = 600, $height = 400, $zoom = 10, $responseType = 'png')
public function getStaticMapImageCacheKey($width = 600, $height = 400, $zoom = 5, $responseType = 'png')
{
// Build cache key
$cacheKey = 'map-' . $this->id . '-static-image-' . $width . 'x' . $height . 'x' . $zoom . '.' . $responseType;
Expand Down

0 comments on commit d23f06b

Please sign in to comment.