20 return self::getPointByPortalRegion();
26 private static function getPointByPortalRegion():
Point
28 $region = self::getCurrentRegion();
31 'ru' => [55.751244, 37.618423],
32 'eu' => [50.85045, 4.34878],
33 'de' => [52.520008, 13.404954],
34 'fr' => [48.864716, 2.349014],
35 'it' => [41.902782, 12.496366],
36 'pl' => [52.237049, 21.017532],
37 'ua' => [50.431759, 30.517023],
38 'by' => [53.893009, 27.567444],
39 'kz' => [43.238949, 76.889709],
40 'in' => [28.644800, 77.216721],
41 'tr' => [39.925533, 32.866287],
42 'id' => [-6.200000, 106.816666],
43 'cn' => [39.916668, 116.383331],
44 'vn' => [21.028511, 105.804817],
45 'jp' => [35.652832, 139.839478],
46 'com' => [47.751076, -120.740135],
47 'es' => [19.432608, -99.133209],
48 'br' => [-15.793889, -47.882778],
51 $coordinates = $map[$region] ?? [51.509865, -0.118092];
53 return (
new Point($coordinates[0], $coordinates[1]));
59 private static function getCurrentRegion(): string
63 if (Loader::includeModule(
'bitrix24'))
65 $licensePrefix = \CBitrix24::getLicensePrefix();
66 if ($licensePrefix !==
false)
68 $result = (string)$licensePrefix;
71 elseif (Loader::includeModule(
'intranet'))
73 $result = (string)\CIntranetUtils::getPortalZone();
75 elseif (defined(
'LANGUAGE_ID'))
77 $result = LANGUAGE_ID;