1function initHalfMap(mapEl, mapData, mapLat, mapLng, mapZoom, mapIcon) { 2 var popupPos = mapEl.data('popup-position'); 3 if (mapData.length <= 0) 4 mapData = mapEl.data('data_show'); 5 if (mapLat.length <= 0) 6 mapLat = mapEl.data('lat'); 7 if (mapLng.length <= 0) 8 mapLng = mapEl.data('lng'); 9 if (mapZoom.length <= 0) 10 mapZoom = mapEl.data('zoom'); 11 if (mapIcon.length <= 0) 12 mapIcon = mapEl.data('icon'); 13 var map = new google.maps.Map(mapEl.get(0), { 14 zoom: mapZoom, 15 center: {lat: parseFloat(mapLat), lng: parseFloat(mapLng)}, 16 disableDefaultUI: true 17 }); 18 bounds = new google.maps.LatLngBounds(); 19 if (typeof mapData != 'undefined' && Object.keys(mapData).length) { 20 var marker = []; 21 var ib = []; 22 var c = {}; 23 var markers = jQuery.map(mapData, function (location, i) { 24 marker[i] = new google.maps.Marker({ 25 position: {lat: parseFloat(location.lat), lng: parseFloat(location.lng)}, 26 options: { 27 icon: mapIcon, 28 animation: google.maps.Animation.DROP 29 }, 30 map: map 31 }); 32 var loc = new google.maps.LatLng(parseFloat(location.lat), parseFloat(location.lng)); 33 bounds.extend(loc); 34 var ibOptions = { 35 content: '', 36 disableAutoPan: true 37 , maxWidth: 0 38 , pixelOffset: new google.maps.Size(-135, -55) 39 , zIndex: null 40 , boxStyle: { 41 padding: "0px 0px 0px 0px", 42 width: "270px", 43 }, 44 closeBoxURL: "", 45 cancelBubble: true, 46 infoBoxClearance: new google.maps.Size(1, 1), 47 isHidden: false, 48 pane: "floatPane", 49 enableEventPropagation: true, 50 alignBottom: true 51 }; 52 if (window.matchMedia("(min-width: 768px)").matches) { 53 if (popupPos == 'right') { 54 ibOptions.pixelOffset = new google.maps.Size(35, -208); 55 ibOptions.alignBottom = false; 56 } 57 } 58 jQuery(window).on('resize',function () { 59 if (window.matchMedia("(min-width: 768px)").matches) { 60 if (popupPos == 'right') { 61 ibOptions.pixelOffset = new google.maps.Size(35, -208); 62 ibOptions.alignBottom = false; 63 } 64 } 65 }); 66 google.maps.event.addListener(marker[i], 'click', (function () { 67 var source = location.content_html; 68 var boxText = document.createElement("div"); 69 if (window.matchMedia("(min-width: 768px)").matches) { 70 if (popupPos == 'right') { 71 boxText.classList.add("right-box"); 72 } 73 } 74 jQuery(window).on('resize',function () { 75 if (window.matchMedia("(min-width: 768px)").matches) { 76 if (popupPos == 'right') { 77 boxText.classList.add("right-box"); 78 } 79 } else { 80 boxText.classList.remove("right-box"); 81 } 82 }); 83 boxText.style.cssText = "border-radius: 5px; background: #fff; padding: 0px;"; 84 boxText.innerHTML = source; 85 ibOptions.content = boxText; 86 var ks = Object.keys(c); 87 if (ks.length) { 88 for (var j = 0; j < ks.length; j++) { 89 c[ks[j]].close(); 90 } 91 } 92 ib[i] = new InfoBox(ibOptions); 93 c[i] = ib[i]; 94 ib[i].open(map, this); 95 map.panTo(ib[i].getPosition()); 96 google.maps.event.addListener(ib[i], 'domready', function () { 97 var closeInfoBox = document.getElementById("close-popup-on-map"); 98 google.maps.event.addDomListener(closeInfoBox, 'click', function () { 99 ib[i].close(); 100 }); 101 }); 102 })); 103 return marker[i]; 104 }); 105 customControlGoogleMap(mapEl.get(0), map); 106 } 107 map.fitBounds(bounds); 108 map.panToBounds(bounds); 109 var listener = google.maps.event.addListener(map, "idle", function () { 110 if (map.getZoom() > 16) 111 map.setZoom(16); 112 google.maps.event.removeListener(listener); 113 });
vendor: 1 bytes, line 114
114}
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.