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 = isset($cfg['api_key']) ? $cfg['api_key'] : ''; break; default: $key = ''; break; } return $key; } public function MapStyle() { return MapboxField::config()->get('map_style'); } }