diff --git a/lib/OpenLayers/Format/OWSContext/v0_3_1.js b/lib/OpenLayers/Format/OWSContext/v0_3_1.js index f1c3de4fff..4a795f86ed 100644 --- a/lib/OpenLayers/Format/OWSContext/v0_3_1.js +++ b/lib/OpenLayers/Format/OWSContext/v0_3_1.js @@ -440,7 +440,9 @@ OpenLayers.Format.OWSContext.v0_3_1 = OpenLayers.Class(OpenLayers.Format.XML, { var node = this.createElementNSPlus("Style"); this.writeNode("Name", style, node); this.writeNode("Title", style, node); - this.writeNode("LegendURL", style, node); + if (style.legend) { + this.writeNode("LegendURL", style, node); + } return node; }, "Name": function(obj) {