Skip to content

Commit

Permalink
4.0.5
Browse files Browse the repository at this point in the history
### Fixed
- Fix referred on Mapbox geo requests (Fixes #338, via @maxdmyers)
- Fix type errors in front-end usage (Fixes #379, via @samhibberd)
- Fix error when normalizing invalid location (Fixes #368, #380, via @Decyphr)
- Fix intermittent issues w/ Google Maps API loading (Fixes #294, via @davidwebca)
- Allow nullable zoom value (Fixes #381)
- Pass site language to embedded Google map (Fixes #373)
- Support casting map to string (Fixes #362)
- Remove reference to MaxMind Lite from docs (Fixes #358)
  • Loading branch information
Tam committed Apr 4, 2024
1 parent 73fb1d3 commit 5de1d9a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 4.0.5 - 2024-04-04
### Fixed
- Fix referred on Mapbox geo requests (Fixes #338, via @maxdmyers)
- Fix type errors in front-end usage (Fixes #379, via @samhibberd)
- Fix error when normalizing invalid location (Fixes #368, #380, via @Decyphr)
- Fix intermittent issues w/ Google Maps API loading (Fixes #294, via @davidwebca)
- Allow nullable zoom value (Fixes #381)
- Pass site language to embedded Google map (Fixes #373)
- Support casting map to string (Fixes #362)
- Remove reference to MaxMind Lite from docs (Fixes #358)

## 4.0.4 - 2023-06-26
### Fixed
- Update settings autosuggest input (Fixes #374)
Expand Down
5 changes: 1 addition & 4 deletions docs/getting-started/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ needed!
##### [ipstack](https://ipstack.com/product)
ipstack offer free and paid-for versions of their API.

##### MaxMind Lite
No token required

##### [MaxMind](https://www.maxmind.com/en/geoip2-precision-services)
MaxMind offer free lookup database that must be stored locally, and a more
accurate paid-for version of their API.
Expand Down Expand Up @@ -197,7 +194,7 @@ constants.
use ether\simplemap\services\GeoLocationService;

return [
'geoLocationService' => GeoLocationService::MaxMindLite,
'geoLocationService' => GeoLocationService::MaxMind,
];
```

Expand Down
7 changes: 6 additions & 1 deletion src/models/BaseLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class BaseLocation extends Model
public function __construct ($config = [])
{
Typecast::properties(static::class, $config);

parent::__construct($config);

if ($this->address === null)
Expand Down Expand Up @@ -115,4 +115,9 @@ public function address (array $exclude = [], string $glue = '<br/>'): Markup
return new Markup(implode($glue, $addr), 'utf8');
}

public function __toString(): string
{
return (string) $this->address([], ', ');
}

}
2 changes: 1 addition & 1 deletion src/models/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Map extends BaseLocation
public ?int $fieldId = null;

/** @var int */
public int $zoom = 15;
public ?int $zoom = 15;

/** @var int|float|null */
public int|null|float $distance = null;
Expand Down
1 change: 1 addition & 0 deletions src/services/EmbedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ private function _embedGoogle (EmbedOptions $options, Settings $settings): strin
$params = http_build_query([
'key' => $settings->getMapToken(),
'callback' => $callbackName,
'language' => Craft::$app->getSites()->getCurrentSite()->language,
]);

$js = <<<JS
Expand Down

0 comments on commit 5de1d9a

Please sign in to comment.