1document.addEventListener('DOMContentLoaded', function() { 2 function copyUrl() { 3 const shareUrlBtns = document.querySelectorAll('.copy-url') 4 const url = window.location 5 6 async function handleShare() { 7 const sharedData = { 8 url: url, 9 } 10 11 if (!navigator.share || (navigator.canShare && !navigator.canShare(sharedData))) { 12 await copyLink() 13 return 14 } 15 16 try { 17 await navigator.share(sharedData) 18 } catch (e) { 19 alert(`Ðе ÑдалоÑÑ Ð¿Ð¾Ð´ÐµÐ»Ð¸ÑÑÑÑ: ${e}`) 20 } 21 }; 22 23 async function copyLink() { 24 if (!navigator.clipboard) return 25 26 try { 27 await navigator.clipboard.writeText(url) 28 alert('СÑÑлка ÑкопиÑована') 29 } catch (err) { 30 alert(`Ðе ÑдалоÑÑ ÑкопиÑоваÑÑ: ${err}`) 31 } 32 }; 33 34 shareUrlBtns.forEach((button) => { 35 button.addEventListener('click', () => { 36 handleShare(); 37 }) 38 }) 39 } 40 41 copyUrl() 42 43 ymaps.ready(init); 44 45 function init() { 46 const myMap = new ymaps.Map("map", { 47 center: [55.79295961159026, 49.138520537639614], 48 zoom: 16, 49 controls: [] 50 }, { 51 yandexMapDisablePoiInteractivity: true 52 }), 53 54 mainIconLayout = ymaps.templateLayoutFactory.createClass( 55 `<div class="placemark"> 56 <div class="placemark__balloon"> 57 <div class="placemark__info"> 58 <p class="placemark__title">ÐХУ им. Ð.Ð.ФеÑина</p> 59 <p class="placemark__subtitle">$[properties.iconContent]</p> 60 </div> 61 </div> 62 <div class="placemark__arrow"></div> 63 </div>`, 64 { 65 build: function () { 66 mainIconLayout.superclass.build.call(this); 67 const element = this.getParentElement().getElementsByClassName('placemark')[0]; 68 const size = 30; 69 const shape = { type: 'Circle', coordinates: [10, 10], radius: size / 2 }; 70 this.getData().options.set({ 'shape': shape }); 71 } 72 } 73 ), 74 75 KMarksaPlacemark = new ymaps.Placemark([55.794436, 49.139167], { 76 iconContent: 'ÐаÑла ÐаÑкÑа, 70' 77 }, { 78 hasBalloon: false, 79 iconLayout: mainIconLayout, 80 zIndex: 774 81 }), 82 83 MushtariPlacemark = new ymaps.Placemark([55.791445, 49.135169], { 84 iconContent: 'ÐÑÑÑаÑи, 16' 85 }, { 86 hasBalloon: false, 87 iconLayout: mainIconLayout, 88 zIndex: 774 89 }); 90 91 myMap.geoObjects 92 .add(KMarksaPlacemark) 93 .add(MushtariPlacemark) 94 95 const searchControl = new ymaps.control.SearchControl({ 96 options: { 97 size: 'small', 98 provider: 'yandex#search' 99 } 100 }); 101 102 myMap.controls.add('zoomControl'); 103 myMap.controls.add('geolocationControl'); 104 myMap.controls.add(searchControl); 105 } 106})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.