strokeWidth: parseInt(weight, 10) || 1,
516 fitToViewport: function () { 517 map.container.fitToViewport(); 519 destroy: function () { 524 const mapLang = t_map__getLang(recid); 526 const copyrightLink = ymap.querySelector('[class*="copyright__link"'); 528 copyrightLink.href = mapLang === 'ru_RU' ? 'https://yandex.ru/legal/maps_termsofuse/ru/' : 529 'https://yandex.com/legal/maps_termsofuse/en/'; 534function t_map_hexToHsl(H) { 535 // Convert hex to RGB first 536 var r = 0, g = 0, b = 0; 537 if (H.length === 4) { 538 r = '0x' + H[1] + H[1]; 539 g = '0x' + H[2] + H[2]; 540 b = '0x' + H[3] + H[3]; 541 } else if (H.length === 7) { 542 r = '0x' + H[1] + H[2]; 543 g = '0x' + H[3] + H[4]; 544 b = '0x' + H[5] + H[6]; 550 var cmin = Math.min(r,g,b), 551 cmax = Math.max(r,g,b), 560 h = ((g - b) / delta) % 6; 562 h = (b - r) / delta + 2; 564 h = (r - g) / delta + 4; 566 h = Math.round(h * 60); 571 l = (cmax + cmin) / 2; 572 s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)); 573 s = +(s * 100).toFixed(1); 574 l = +(l * 100).toFixed(1); 579function t_map__getLang(recid) { 582 const tildaMapElement = document.querySelector('#rec' + recid + ' .t-map'); 583 const tildaMapElAttr = tildaMapElement.getAttribute('data-map-language'); 584 if (tildaMapElement) { 585 switch (tildaMapElAttr) {