[OpenLayers-Trac] [OpenLayers] #3045: Writing OWSContext fails if style has no legend

OpenLayers trac-20090302 at openlayers.org
Mon Feb 7 08:29:53 EST 2011


#3045: Writing OWSContext fails if style has no legend
------------------------------+---------------------------------------------
 Reporter:  hbruch            |       Owner:  bartvde     
     Type:  bug               |      Status:  new         
 Priority:  major             |   Milestone:  2.11 Release
Component:  Format.OWSCommon  |     Version:  2.10        
 Keywords:                    |       State:              
------------------------------+---------------------------------------------
 Writing a map via OWSContext for my map result in an "TypeError: options
 is undefined". Apparently this was caused by a missing legend of the
 style.

 Otherwise, changing the Style-Writer in v0_3_1.js as below would work for
 me.

            "Style": function(style) {
                 var node = this.createElementNSPlus("Style");
                 this.writeNode("Name", style, node);
                 this.writeNode("Title", style, node);
                 // only write LegendURL if it's known:
                 if (style.legend) this.writeNode("LegendURL", style,
 node);
                 return node;
             }


 Best regards,
 Holger

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3045>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list