39 lines
769 B
PHP
39 lines
769 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Core;
|
|
|
|
|
|
final class MapovyPodklad
|
|
{
|
|
public const COOKIE = 'mapovyPodklad';
|
|
|
|
public const OSM = 'osm';
|
|
|
|
public const MAPYCZ = 'mapycz';
|
|
|
|
public const MAPYCZ_LETECKA = 'mapycz-letecka';
|
|
|
|
public const VYCHOZI = self::OSM;
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public static function moznosti(): array
|
|
{
|
|
return [
|
|
self::OSM => 'OpenStreetMap',
|
|
self::MAPYCZ => 'Mapy.cz',
|
|
self::MAPYCZ_LETECKA => 'Mapy.cz (letecká)',
|
|
];
|
|
}
|
|
|
|
public static function platny(?string $hodnota): string
|
|
{
|
|
return array_key_exists((string) $hodnota, self::moznosti())
|
|
? (string) $hodnota
|
|
: self::VYCHOZI;
|
|
}
|
|
}
|