[OpenLayers-Trac] [OpenLayers] #100: create a WMC parser

OpenLayers trac at openlayers.org
Wed Jan 9 07:50:26 EST 2008


#100: create a WMC parser
----------------------------+-----------------------------------------------
  Reporter:  hobu at hobu.net  |       Owner:  tschaub    
      Type:  feature        |      Status:  new        
  Priority:  minor          |   Milestone:  2.6 Release
 Component:  Map            |     Version:             
Resolution:                 |    Keywords:             
     State:                 |  
----------------------------+-----------------------------------------------
Comment (by bartvde):

 For Style both Name and Title are required, so I changed the function to:

 {{{
     write_wmc_StyleList: function(layer) {
         var node = this.createElementDefaultNS("StyleList");
         var style = this.createElementDefaultNS(
             "Style", null, {current: "1"}
         );
         node.appendChild(style);
         var stylename = '';
         if (!layer.params["STYLES"] || (layer.params["STYLES"] == '')) {
             stylename = 'default';
         } else {
             stylename = layer.params["STYLES"];
         }
         style.appendChild(this.createElementDefaultNS(
             "Name", stylename ));
         style.appendChild(this.createElementDefaultNS(
             "Title", 'Default' ));
         return node;
     },

 }}}

-- 
Ticket URL: <http://trac.openlayers.org/ticket/100#comment:20>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list