Changeset 3613 for TI05-delivery
- Timestamp:
- 14/03/08 16:48:12 (13 years ago)
- Location:
- TI05-delivery/ows_framework/trunk/ows_server/ows_server
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/capabilities.js
r3547 r3613 122 122 } 123 123 }, 124 getDimensions: function() { 125 var i; 126 var dimObj; 127 var dims = {}; 128 var dimEls = this.node.getElementsByTagName('Dimension'); 129 for (i=0; i<dimEls.length; i++) { 130 dimObj = new WMSC.Dimension(dimEls[i]); 131 dims[dimObj.getName()] = dimObj; 132 } 133 134 return dims; 124 getDimensions: function() 125 { 126 var i; 127 var dimObj; 128 var dims = {}; 129 var dimEls = this.node.getElementsByTagName('Dimension'); 130 for (i=0; i<dimEls.length; i++) 131 { 132 dimObj = new WMSC.Dimension(dimEls[i]); 133 dims[dimObj.getName()] = dimObj; 134 } 135 136 return dims; 135 137 }, 136 138 -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/vis-app.js
r3607 r3613 98 98 // retrieve the elements of the layer list and add these to the map 99 99 layerList = document.getElementById("layerlist"); 100 100 101 for (var i = 0; i < layerList.childNodes.length; i++) 101 102 { … … 122 123 transparent: 'true' 123 124 }); 125 // add any dimension parameters that may have been set 126 mapLayer.mergeNewParams(this.layerControl.wmsParams); 124 127 mapLayer.setZIndex(300); 125 128 this.map.addLayer(mapLayer); -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/wmscControl.js
r3607 r3613 2 2 // Javascript WMS client control. 3 3 // - borrowed from the DCIP code to use in the view functionality for WMC and granules data 4 // C Byrom// 4 // C Byrom 5 // 5 6 6 7 /** … … 158 159 nodeData.layer = layer.getName(); 159 160 nodeData.abstract = layer.getAbstract(); 161 nodeData.layerData = layer; 160 162 161 163 var subLayers = layer.getSubLayers(); … … 252 254 }); 253 255 }, 254 255 256 257 // Maybe a way of generating a callback that leaks less memory in IE6?258 _makeTreeNodeListener: function(layer)259 {260 var f = function(evt) {261 this.selectLeafLayer(layer, Event.element(evt));262 }263 return f.bindAsEventListener(this);264 },265 256 266 257 selectTreeNode: function(node) … … 325 316 // set the selected layer 326 317 this._selectedLayer = node; 327 this.wmsParams.layers = node.data.layer; 318 319 // update the selections control to match the selected layer 320 this._updateDomainDiv(); 321 322 // now refresh the displayed map layers - this is done in the vis-app.updateVisLayer fn 328 323 this.events.triggerEvent('changeWMS'); 329 330 324 } 331 325 else … … 375 369 376 370 371 // update what layers are displayed in the layer panel and add appropriate event listeners 372 // to their associated delete icons 377 373 _updateLeafLayer: function(xhr) 378 374 { … … 451 447 return null; 452 448 }, 453 454 selectLeafLayer: function(layer, element) 455 { 456 WMSC.log('in selectLeafLayer'); 457 var dims = layer.getDimensions(); 449 450 451 // update the selections div with dimensions relevant to the 452 // currently selected layer 453 _updateDomainDiv: function() 454 { 455 var dims = this._selectedLayer.data.layerData.getDimensions(); 458 456 var dimId, dimText, div, i; 459 var select, extent, option;460 461 this._selectedLayer = layer;462 this.wmsParams.layers = layer.getName();463 464 if (this._selectedLayerElement)465 {466 this._selectedLayerElement.className = 'WMSC_leafLayer';467 }468 this._selectedLayerElement = element;469 this._selectedLayerElement.className = 'WMSC_selectedField';470 457 471 458 $(this.dimForm).innerHTML = ''; … … 491 478 492 479 Event.observe(select, 'change', this.selectDimValue.bindAsEventListener(this)); 493 494 480 div.appendChild(select); 495 481 $(this.dimForm).appendChild(div); 496 482 } 483 }, 484 485 486 selectDimValue: function(evt) 487 { 488 var select = Event.element(evt); 489 var value = select.options[select.selectedIndex].value; 490 var dims = this._selectedLayer.data.layerData.getDimensions(); 491 492 this._selectedDims[select.name] = this.getDimensionText(dims[select.name], value); 493 this.wmsParams[select.name] = value; 494 497 495 this.events.triggerEvent('changeWMS'); 498 },499 selectDimValue: function(evt) {500 var select = Event.element(evt);501 var value = select.options[select.selectedIndex].value;502 var dims = this._selectedLayer.getDimensions();503 504 this._selectedDims[select.name] = this.getDimensionText(dims[select.name], value);505 this.wmsParams[select.name] = value;506 507 this.events.triggerEvent('changeWMS');508 496 }, 509 497 … … 511 499 this.events.triggerEvent('changeSelection'); 512 500 }, 513 _initDomainDiv: function(bbox) { 514 $(this.domainDiv).innerHTML = 501 502 _initDomainDiv: function(bbox) 503 { 504 $(this.domainDiv).innerHTML = 515 505 '<div class="WMSC_domain">'+ 516 506 '<form id="WMSC_sel"><table>'+ … … 532 522 '<div id="WMSC_dimDiv" class="WMSC_domain"><form id="WMSC_dimForm"></form></div>'; 533 523 534 $('WMSC_clear').onclick = this.clearSelection.bindAsEventListener(this);535 this.dimForm = 'WMSC_dimForm';536 this.selForm = 'WMSC_sel';537 538 var listener = this._selectionListener.bindAsEventListener(this);539 var selForm = $(this.selForm);540 541 Event.observe(selForm.minLon, 'change', listener);542 Event.observe(selForm.minLat, 'change', listener);543 Event.observe(selForm.maxLon, 'change', listener);544 Event.observe(selForm.maxLat, 'change', listener);524 $('WMSC_clear').onclick = this.clearSelection.bindAsEventListener(this); 525 this.dimForm = 'WMSC_dimForm'; 526 this.selForm = 'WMSC_sel'; 527 528 var listener = this._selectionListener.bindAsEventListener(this); 529 var selForm = $(this.selForm); 530 531 Event.observe(selForm.minLon, 'change', listener); 532 Event.observe(selForm.minLat, 'change', listener); 533 Event.observe(selForm.maxLon, 'change', listener); 534 Event.observe(selForm.maxLat, 'change', listener); 545 535 546 this.setSelection(bbox); 547 }, 548 clearSelection: function() { 549 this.setSelection(this.GLOBAL_BOUNDS); 550 }, 551 getSelection: function() { 552 return new OpenLayers.Bounds($(this.selForm).minLon.value, 536 this.setSelection(bbox); 537 }, 538 539 clearSelection: function() 540 { 541 this.setSelection(this.GLOBAL_BOUNDS); 542 }, 543 544 getSelection: function() 545 { 546 return new OpenLayers.Bounds($(this.selForm).minLon.value, 553 547 $(this.selForm).minLat.value, 554 548 $(this.selForm).maxLon.value, … … 556 550 }, 557 551 558 setSelection: function(bbox, noCascade) { 559 560 var old_b = this.getSelection(); 561 562 // Validation. negative tests required to catch NaN 563 if (!(bbox.left > -180.0 && bbox.left < 180.0)) { 564 bbox.left = old_b.left; 565 } 566 if (!(bbox.right > -180.0 && bbox.right < 180.0)) { 567 bbox.right = old_b.right; 568 } 569 if (!(bbox.top > -90.0 && bbox.top < 90.0)) { 570 bbox.top = old_b.top; 571 } 572 if (!(bbox.bottom > -90.0 && bbox.bottom < 90.0)) { 573 bbox.bottom = old_b.bottom; 574 } 575 if (bbox.left > bbox.right) { 576 var t = bbox.left; bbox.left = bbox.right; bbox.right = t; 577 } 578 if (bbox.bottom > bbox.top) { 579 var t = bbox.bottom; bbox.bottom = bbox.top; bbox.top = t; 580 } 581 582 $(this.selForm).minLon.value = bbox.left; 583 $(this.selForm).minLat.value = bbox.bottom; 584 $(this.selForm).maxLon.value = bbox.right; 585 $(this.selForm).maxLat.value = bbox.top; 586 587 if (noCascade != true) { 588 this.events.triggerEvent('changeSelection'); 589 } 552 setSelection: function(bbox, noCascade) 553 { 554 555 var old_b = this.getSelection(); 556 557 // Validation. negative tests required to catch NaN 558 if (!(bbox.left > -180.0 && bbox.left < 180.0)) 559 bbox.left = old_b.left; 560 561 if (!(bbox.right > -180.0 && bbox.right < 180.0)) 562 bbox.right = old_b.right; 563 564 if (!(bbox.top > -90.0 && bbox.top < 90.0)) 565 bbox.top = old_b.top; 566 567 if (!(bbox.bottom > -90.0 && bbox.bottom < 90.0)) 568 bbox.bottom = old_b.bottom; 569 570 if (bbox.left > bbox.right) 571 { 572 var t = bbox.left; 573 bbox.left = bbox.right; 574 bbox.right = t; 575 } 576 577 if (bbox.bottom > bbox.top) 578 { 579 var t = bbox.bottom; 580 bbox.bottom = bbox.top; 581 bbox.top = t; 582 } 583 584 $(this.selForm).minLon.value = bbox.left; 585 $(this.selForm).minLat.value = bbox.bottom; 586 $(this.selForm).maxLon.value = bbox.right; 587 $(this.selForm).maxLat.value = bbox.top; 588 589 if (noCascade != true) { 590 this.events.triggerEvent('changeSelection'); 591 } 590 592 }, 591 593 -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/viewItems.kid
r3607 r3613 54 54 function init() 55 55 { 56 control = new WMSC.Control('layerTree', 'layerLeaves', 'dims');56 control = new DDC_Control('layerTree', 'layerLeaves', 'dims'); 57 57 <for py:for="i in session['viewItems']" class="dataset" py:strip="True"> 58 58 <span py:if="i.wmcURL" py:strip="True">
Note: See TracChangeset
for help on using the changeset viewer.