1;(function($) { 2 3 lp_init = function (block_wrapper) { 4 5 } 6 7 function coords(str) { 8 return str.split(','); 9 } 10 11 12 function init(options) { 13 options.center = coords(options.center); 14 15 $.each(options.data, function(key, item) { 16 item.coords = coords(item.coords); 17 }); 18 19 if (options.type == 'google') { 20 21 //google.maps.event.addDomListener(window, 'load', function() { 22 23 var map = new google.maps.Map(document.getElementById(options.id), { 24 zoom: parseInt(options.zoom), 25 center: new google.maps.LatLng(options.center[0], options.center[1]), 26 scrollwheel: false 27 }); 28 29 $.each(options.data, function(key, item) { 30 31 32 var marker = new google.maps.Marker({ 33 position: new google.maps.LatLng(item.coords[0], item.coords[1]), 34 map: map, 35 title: item.name 36 }); 37 38 var infowindow = new google.maps.InfoWindow({ 39 content: '<div class="baloon-content">' + 40 '<h3>' + item.name + '</h3>' + 41 item.desc + 42 '</div>' 43 }); 44 45 google.maps.event.addListener(marker, 'click', function() { 46 infowindow.open(map, marker); 47 }); 48 49 }); 50 //}); 51 52 } else { 53 54 function ymapsInit() { 55 ymaps.ready(function() { 56 57 var map = new ymaps.Map(options.id, { 58 center: options.center, 59 zoom: options.zoom, 60 behaviors: ['drag', 'rightMouseButtonMagnifier'], 61 }); 62 63 map.controls.add( 64 new ymaps.control.ZoomControl() 65 ); 66 67 var MyBalloonContentLayoutClass = ymaps.templateLayoutFactory.createClass( 68 '<div class="baloon-content">' + 69 '<h3>$[properties.name]</h3>' + 70 '$[properties.desc]' + 71 '</div>' 72 ); 73 74 var myCollection = new ymaps.GeoObjectCollection(); 75 76 $.each(options.data, function(key, item) { 77 myCollection.add(new ymaps.Placemark( 78 item.coords, 79 item, 80 {balloonContentLayout: MyBalloonContentLayoutClass} 81 )); 82 }); 83 84 map.geoObjects.add(myCollection); 85 86 }); 87 } 88 89 if (typeof(window['google']) == "undefined") { 90 $.getScript( "http://api-maps.yandex.ru/2.0-stable/?load=package.full&lang=ru" ).done(function( script, textStatus ) { 91 ymapsInit(); 92 }); 93 } else { 94 ymapsInit(); 95 } 96 97 } 98 99 } 100 101 window.mjsMap = init; 102 103})(jQuery);
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.