This commit is contained in:
Dane Springmeyer 2014-04-28 15:57:51 -07:00
parent 580e946cc0
commit 4f771ed2a5

View File

@ -97,6 +97,7 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
}
sym_order = symbolizerList(sym_order);
var sym_count = 0;
for (var i = 0; i < sym_order.length; i++) {
var attributes = symbolizers[sym_order[i]];
@ -105,6 +106,7 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
// Skip the magical * symbolizer which is used for universal properties
// which are bubbled up to Style elements intead of Symbolizer elements.
if (symbolizer === '*') continue;
sym_count++;
var fail = tree.Reference.requiredProperties(symbolizer, attributes);
if (fail) {
@ -147,7 +149,7 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
}
}
}
if (!xml) return '';
if (!sym_count || !xml) return '';
return ' <Rule>\n' + xml + ' </Rule>\n';
};