725
725
updateLegend: function() {
726
var element = document.createElement("div"),
726
var view = this.view,
727
response = this.gis.response,
728
isPlugin = this.gis.plugin,
729
element = document.createElement("div"),
735
style.dataLineHeight = isPlugin ? '12px' : '14px';
736
style.dataPaddingBottom = isPlugin ? '1px' : '3px';
737
style.colorWidth = isPlugin ? '15px' : '30px';
738
style.colorHeight = isPlugin ? '13px' : '15px';
739
style.colorMarginRight = isPlugin ? '5px' : '8px';
740
style.fontSize = isPlugin ? '10px' : '11px';
732
id = this.view.columns[0].items[0].id;
733
name = this.view.columns[0].items[0].name;
743
id = view.columns[0].items[0].id;
744
name = view.columns[0].items[0].name;
734
745
child = document.createElement("div");
735
child.style.lineHeight = "14px";
736
child.style.paddingBottom = "3px";
737
child.innerHTML += this.gis.response.metaData.names[id] || name || id;
746
child.style.lineHeight = style.dataLineHeight;
747
child.style.paddingBottom = style.dataPaddingBottom;
748
child.innerHTML += response.metaData.names[id] || name || id;
738
749
child.innerHTML += "<br/>";
741
id = this.view.filters[0].items[0].id;
742
name = this.view.filters[0].items[0].name;
743
child.innerHTML += this.gis.response.metaData.names[id] || name || id;
752
id = view.filters[0].items[0].id;
753
name = view.filters[0].items[0].name;
754
child.innerHTML += response.metaData.names[id] || name || id;
744
755
element.appendChild(child);
746
757
child = document.createElement("div");
748
759
element.appendChild(child);
751
if (this.view.legendSet) {
762
if (view.legendSet) {
752
763
for (var i = 0; i < this.classification.bins.length; i++) {
753
764
child = document.createElement("div");
754
765
child.style.backgroundColor = this.colorInterpolation[i].toHexString();
755
child.style.width = "30px";
756
child.style.height = this.view.legendSet.names[i] ? "25px" : "20px";
757
child.style.cssFloat = "left";
758
child.style.marginRight = "8px";
766
child.style.width = style.colorWidth;
767
child.style.height = view.legendSet.names[i] ? '25px' : style.colorHeight;
768
child.style.cssFloat = 'left';
769
child.style.marginRight = style.colorMarginRight;
759
770
element.appendChild(child);
761
772
child = document.createElement("div");
762
child.style.lineHeight = this.view.legendSet.names[i] ? "12px" : "7px";
763
child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (this.view.legendSet.names[i] || '') + '</b><br/>' + this.classification.bins[i].label;
773
child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
774
child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (view.legendSet.names[i] || '') + '</b><br/>' + this.classification.bins[i].label;
764
775
element.appendChild(child);
766
777
child = document.createElement("div");
772
783
for (var i = 0; i < this.classification.bins.length; i++) {
773
784
child = document.createElement("div");
774
785
child.style.backgroundColor = this.colorInterpolation[i].toHexString();
775
child.style.width = "30px";
776
child.style.height = "15px";
777
child.style.cssFloat = "left";
778
child.style.marginRight = "8px";
786
child.style.width = style.colorWidth;
787
child.style.height = style.colorHeight;
788
child.style.cssFloat = 'left';
789
child.style.marginRight = style.colorMarginRight;
779
790
element.appendChild(child);
781
792
child = document.createElement("div");