1function GoogleMapsChecksControl(controlDiv, $rootScope, legendList, listCount, legendId) { 2 3 controlDiv.style.padding = '5px'; 4 5 var controlUI = document.createElement('div'); 6 7 controlUI.style.backgroundColor = 'white'; 8 controlUI.style.borderStyle = 'solid'; 9 controlUI.style.borderWidth = '1px'; 10 controlUI.style.borderColor = '#B3BDC9'; 11 controlUI.style.textAlign = 'left'; 12 controlUI.style.boxShadow = 'rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px'; 13 controlUI.style.borderRadius = '2px'; 14 controlUI.style.width = '300px'; 15 controlUI.style.opacity = '0.7'; 16 controlUI.style.overflowY = 'auto'; 17 18 if (listCount == 1) { 19 20 controlUI.style.maxHeight = '500px'; 21 } else { 22 23 controlUI.style.maxHeight = '240px'; 24 } 25 26 controlDiv.appendChild(controlUI); 27 28 for (var i = 0; i < legendList.length; i++) { 29 30 legendList[i].fullDescription = legendList[i].description; 31 32 if (legendList[i].description.length > 32) { 33 34 legendList[i].description = legendList[i].description.substr(0, 32); 35 legendList[i].description += "..."; 36 } 37 38 var controlText = document.createElement('div'); 39 40 if (legendList[i].color) { 41 42 controlText.innerHTML = "<input checked type='checkbox' id='" + legendId + "_" + legendList[i].id + "' value='" + legendList[i].id + "' style='float:left;margin-left: 5px;' onchange='mapFilterTrigger(\"" + legendId + "\",\"" + legendList[i].id + "\",this.checked)'><div style='float:left;width: 20px;height:12px;margin-left:4px;margin-right:4px;margin-top:4px;border:1px solid #333333; background: #" + legendList[i].color + ";'></div><label for='" + legendId + "_" + legendList[i].id + "' title='" + legendList[i].fullDescription + "'" + " style='margin-top:2px;font-size:12px;'>" + legendList[i].description + "</label>"; 43 } else { 44 45 controlText.innerHTML = "<input checked type='checkbox' id='" + legendId + "_" + legendList[i].id + "' value='" + legendList[i].id + "' style='float:left;margin-left: 5px;' onchange='mapFilterTrigger(\"" + legendId + "\",\"" + legendList[i].id + "\",this.checked)'><label for='" + legendId + "_" + legendList[i].id + "' value='" + legendList[i].id + "' title='" + legendList[i].fullDescription + "'" + " style='margin-top:2px;margin-left: 4px;font-size:12px;'>" + legendList[i].description + "</label>"; 46 } 47 48 controlUI.appendChild(controlText); 49 } 50 51 window.mapFilterTrigger = function (legendId, checkboxId, isChecked) { 52 53 var all = "#" + legendId + "_" + 0; 54 var general = '[id*="' + legendId + '_"]'; 55 var checkedCount = 0; 56 var notCheckedCount = 0; 57 var checkBoxIdList = []; 58 var regexp = new RegExp(legendId + "_", "g"); 59 var isAllTrue; 60 61 62 if (checkboxId == 0) { 63 64 if (!$(all).prop('checked')) { 65 66 $(general).prop('checked', false); 67 isAllTrue = false; 68 } else { 69 70 $(general).prop('checked', true); 71 isAllTrue = true; 72 } 73 } else { 74 75 $(general).each(function (i, el) { 76 77 checkBoxIdList.push({id: el.id.replace(regexp, ""), isChecked: $(el).prop('checked')}); 78 }); 79 80 for (var i = 0; i < checkBoxIdList.length; i++) { 81 82 83 if (checkBoxIdList[i].isChecked == true) { 84 85 checkedCount++; 86 } else { 87 88 notCheckedCount++; 89 } 90 } 91 92 if ((checkBoxIdList.length - 1) == checkedCount) { 93 94 if ($(all).prop('checked')) { 95 96 $(all).prop('checked', false); 97 } else { 98 99 $(all).prop('checked', true); 100 } 101 } else { 102 103 $(all).prop('checked', false); 104 } 105 } 106 107 108 $rootScope.$emit("mapFilterChanged", legendId, checkboxId, isChecked, isAllTrue); 109 }; 110}
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.