Changeset 3645 for TI05-delivery/ows_framework
- Timestamp:
- 18/03/08 14:12:19 (13 years ago)
- Location:
- TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/vis-app.js
r3613 r3645 110 110 // extract the required info and load the map 111 111 // NB, these values are set in the wmscControl._updateLeafLayer() method 112 // NB, for transparancy to be fully supported, the format must be gif 113 // - png is only partially supported and jpg not at all 112 114 endpoint = child.getAttribute("wmcURL"); 113 115 title = child.getAttribute("title"); … … 136 138 this.map.addLayer(this.boxesLayer); 137 139 138 //this.loadLegend();140 this.loadLegend(); 139 141 }, 140 142 … … 147 149 loadLegend: function() 148 150 { 149 function setLegend(response) 150 { 151 $('legend').innerHTML = response.responseText; 152 } 153 154 if (this.layerControl.wmsEndpoint == null) 151 function setLegend(xhr) 152 { 153 alert('bloo'); 154 $('legend').innerHTML = xhr.responseXML.documentElement; 155 } 156 157 function noLegend(response) 158 { 159 alert('blah'); 160 } 161 162 // set the legend to be the topmost layer that has been picked 163 // NB, there is a boxes layer and coastline layer on top of this 164 // - also, there is a base map - so ignore legend if only three layers 165 var layerNo = this.map.layers.length; 166 if (layerNo < 4) 155 167 { 156 168 $('legend').innerHTML = ''; 169 return; 170 } 171 172 var topLayer = this.map.layers[layerNo - 3]; 173 174 if (topLayer.url == null) 175 { 176 $('legend').innerHTML = ''; 157 177 } 158 178 else 159 179 { 160 var url = t his.visLayer.getFullRequestString({180 var url = topLayer.getFullRequestString({ 161 181 REQUEST: 'GetLegend', 162 182 FORMAT: 'text/html' 163 183 }); 164 OpenLayers.loadURL(url, '', this, setLegend); 184 185 new Ajax.Request(url, 186 {parameters: {}, 187 method: "get", 188 onSuccess: setLegend.bindAsEventListener(this) 189 }); 190 191 //OpenLayers.loadURL(url, '', this, setLegend, noLegend); 165 192 } 166 193 },
Note: See TracChangeset
for help on using the changeset viewer.