mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
FIX: MapAPI key
This commit is contained in:
parent
883e0c193d
commit
110ec251a7
@ -160,9 +160,24 @@ class SiteConfigExtension extends DataExtension
|
|||||||
)*/
|
)*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function MapAPIKey()
|
public static function MapAPIKey(): string
|
||||||
{
|
{
|
||||||
return MapboxField::config()->get('access_token');
|
$type = $this->owner->config()->get('map_type');
|
||||||
|
|
||||||
|
switch ($type) {
|
||||||
|
case 'mapbox':
|
||||||
|
$key = MapboxField::getAccessToken();
|
||||||
|
break;
|
||||||
|
case 'google-maps':
|
||||||
|
$cfg = Config::inst()->get(GoogleMapField::class, 'default_options');
|
||||||
|
$key = $cfg['api_key'];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$key = '';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function MapStyle()
|
public function MapStyle()
|
||||||
|
Loading…
Reference in New Issue
Block a user