1function MapForm() 2{ 3 this.mapsForm = null; 4 5 this.createForm = function() 6 { 7 this.mapsForm = document.getElementById('mapsForm'); 8 9 if (this.mapsForm == null) 10 { 11 this.mapsForm = document.createElement('div'); 12 this.mapsForm.style.height = '80%'; 13 this.mapsForm.style.width = '90%'; 14 this.mapsForm.style.margin = 'auto'; 15 this.mapsForm.style.position = 'relative'; 16 this.mapsForm.style.background = '#FAFAFA'; 17 this.mapsForm.id = 'mapsForm'; 18 19 this.mapsForm.innerHTML = 20 '<div id=\'yandexMap\' style=\'position: absolute; top: 10px; left: 10px; bottom: 50px; right: 10px;\'>' + 21 '<div style=\'font-size: 14px; font-weight: bold; margin-top: 28%; text-align: center;\'>ÐодождиÑе, Ð¸Ð´ÐµÑ Ð·Ð°Ð³ÑÑзка каÑÑÑ ...</div>' + 22 '</div>' + 23 '<input type=\'button\' style=\'position: absolute; bottom: 10px; right: 10px;\' value=\'ÐакÑÑÑÑ\' onclick=\'hideModalForm()\'/>'; 24 25 showModalForm(this.mapsForm); 26 27 this.mapsForm.parentNode.style.height = '100%'; 28 this.mapsForm.parentNode.style.top = '5%'; 29 } 30 else 31 { 32 this.mapsForm.parentNode.parentNode.style.display = ''; 33 } 34 } 35 36 this.loadYandexAPI = function() 37 { 38 var script = document.createElement('script'); 39 script.type = 'text/javascript'; 40 script.src = 'http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU&mode=debug'; 41 42 var l = this; 43 var callback = function() 44 { 45 ymaps.ready(function() { l.show() }); 46 } 47 48 if (script.readyState) 49 { 50 script.onreadystatechange = function() 51 { 52 if (script.readyState == 'loaded' || script.readyState == 'complete') 53 { 54 script.onreadystatechange = null; 55 callback(); 56 } 57 }; 58 } 59 else 60 { 61 script.onload = callback; 62 } 63 64 document.getElementsByTagName('head')[0].appendChild(script); 65 } 66 67 this.show = function(latitude, longitude) 68 { 69 if (typeof latitude != 'undefined') this.latitude = latitude; 70 if (typeof longitude != 'undefined') this.longitude = longitude; 71 72 this.createForm(); 73 74 if (typeof ymaps == 'undefined') { this.loadYandexAPI(); return false; } 75 76 document.getElementById('yandexMap').innerHTML = ''; 77 78 var map = new ymaps.Map('yandexMap', { 79 center: [this.longitude, this.latitude], 80 zoom: 15, 81 behaviors: ['default', 'scrollZoom'] 82 }); 83 84 map.controls 85 .add('zoomControl') 86 .add('mapTools'); 87 88 var placemark = new ymaps.Placemark( 89 [this.longitude, this.latitude], 90 { 91 balloonContent: '', 92 iconContent: '' 93 }, 94 { 95 draggable: true, 96 hideIconOnBallon: false 97 } 98 ); 99 100 map.geoObjects.add(placemark); 101 102 /* 103 ymaps.route(['ÐÑаÑноÑÑÑк, Ñл. СопоÑнаÑ, 36', 'ÐÑаÑноÑÑÑк, Ñл. ÐелезнодоÑожников, 17']).then 104 //ymaps.route(['ÐÑаÑноÑÑÑк, Ñл. СопоÑнаÑ, 36', 'ÐÑаÑноÑÑÑк, пÑ. СвободнÑй, 75а']).then 105 ( 106 function(route) 107 { 108 map.geoObjects.add(route); 109 alert(route.getLength()); 110 } 111 ); 112 */ 113 114 return false; 115 } 116}
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.