Skip to content

Commit 5de1d9a

Browse files
committed
4.0.5
### 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)
1 parent 73fb1d3 commit 5de1d9a

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 4.0.5 - 2024-04-04
2+
### Fixed
3+
- Fix referred on Mapbox geo requests (Fixes #338, via @maxdmyers)
4+
- Fix type errors in front-end usage (Fixes #379, via @samhibberd)
5+
- Fix error when normalizing invalid location (Fixes #368, #380, via @Decyphr)
6+
- Fix intermittent issues w/ Google Maps API loading (Fixes #294, via @davidwebca)
7+
- Allow nullable zoom value (Fixes #381)
8+
- Pass site language to embedded Google map (Fixes #373)
9+
- Support casting map to string (Fixes #362)
10+
- Remove reference to MaxMind Lite from docs (Fixes #358)
11+
112
## 4.0.4 - 2023-06-26
213
### Fixed
314
- Update settings autosuggest input (Fixes #374)

docs/getting-started/config.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ needed!
4444
##### [ipstack](https://ipstack.com/product)
4545
ipstack offer free and paid-for versions of their API.
4646

47-
##### MaxMind Lite
48-
No token required
49-
5047
##### [MaxMind](https://www.maxmind.com/en/geoip2-precision-services)
5148
MaxMind offer free lookup database that must be stored locally, and a more
5249
accurate paid-for version of their API.
@@ -197,7 +194,7 @@ constants.
197194
use ether\simplemap\services\GeoLocationService;
198195

199196
return [
200-
'geoLocationService' => GeoLocationService::MaxMindLite,
197+
'geoLocationService' => GeoLocationService::MaxMind,
201198
];
202199
```
203200

src/models/BaseLocation.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ abstract class BaseLocation extends Model
4646
public function __construct ($config = [])
4747
{
4848
Typecast::properties(static::class, $config);
49-
49+
5050
parent::__construct($config);
5151

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

118+
public function __toString(): string
119+
{
120+
return (string) $this->address([], ', ');
121+
}
122+
118123
}

src/models/Map.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Map extends BaseLocation
4040
public ?int $fieldId = null;
4141

4242
/** @var int */
43-
public int $zoom = 15;
43+
public ?int $zoom = 15;
4444

4545
/** @var int|float|null */
4646
public int|null|float $distance = null;

src/services/EmbedService.php

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private function _embedGoogle (EmbedOptions $options, Settings $settings): strin
145145
$params = http_build_query([
146146
'key' => $settings->getMapToken(),
147147
'callback' => $callbackName,
148+
'language' => Craft::$app->getSites()->getCurrentSite()->language,
148149
]);
149150

150151
$js = <<<JS

0 commit comments

Comments
 (0)