Ticket #1452: ticket1452.patch
| File ticket1452.patch, 2.0 kB (added by bartvde, 8 months ago) |
|---|
-
lib/OpenLayers/Format/WMC/v1.js
old new 376 377 }, 377 378 378 379 /** 380 * Method: read_wmc_MetadataURL 381 */ 382 read_wmc_MetadataURL: function(layerInfo, node) { 383 var metadataURL = {}; 384 var links = node.getElementsByTagName("OnlineResource"); 385 if(links.length > 0) { 386 this.read_wmc_OnlineResource(metadataURL, links[0]); 387 } 388 layerInfo.options.metadataURL = metadataURL.href; 389 390 }, 391 392 /** 379 393 * Method: read_wmc_Abstract 380 394 */ 381 395 read_wmc_Abstract: function(obj, node) { … … 603 617 write_wmc_Layer: function(layer) { 604 618 var node = this.createElementDefaultNS( 605 619 "Layer", null, { 606 queryable: "1",620 queryable: layer.queryable ? "1" : "0", 607 621 hidden: layer.visibility ? "0" : "1" 608 622 } 609 623 ); … … 620 634 node.appendChild(this.createElementDefaultNS( 621 635 "Title", layer.name 622 636 )); 637 638 // optional MetadataURL element 639 if (layer.metadataURL) { 640 node.appendChild(this.write_wmc_MetadataURL(layer)); 641 } 623 642 624 643 // optional FormatList element 625 644 node.appendChild(this.write_wmc_FormatList(layer)); … … 727 746 }, 728 747 729 748 /** 749 * Method: write_wmc_MetadataURL 750 * Create a MetadataURL node given a layer object. 751 * 752 * Parameters: 753 * layer - {<OpenLayers.Layer.WMS>} Layer object. 754 * 755 * Returns: 756 * {Element} A WMC metadataURL element node. 757 */ 758 write_wmc_MetadataURL: function(layer) { 759 var node = this.createElementDefaultNS("MetadataURL"); 760 761 // required OnlineResource element 762 node.appendChild(this.write_wmc_OnlineResource(layer.metadataURL)); 763 764 return node; 765 }, 766 767 /** 730 768 * Method: write_wmc_FormatList 731 769 * Create a FormatList node given a layer. 732 770 *
