Don't permit map properties outside of the map.

Fixes #119
This commit is contained in:
Tom MacWright 2012-05-01 15:46:10 -04:00
parent d17416b54f
commit 2c93bed235

View File

@ -68,7 +68,7 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
var xml = ' <Rule>\n';
xml += tree.Zoom.toXML(zoom).join('');
xml += this.filters.toXML(env);
// Sort symbolizers by the index of their first property definition
var sym_order = [], indexes = [];
for (var key in symbolizers) {
@ -107,6 +107,11 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
var selfclosing = true, tagcontent;
xml += ' <' + name + ' ';
for (var key in attributes) {
if (symbolizer === 'map') env.error({
message: 'Map properties are not permitted in other rules',
index: attributes[key].index,
filename: attributes[key].filename
});
var x = tree.Reference.selector(attributes[key].name);
if (x && x.serialization && x.serialization === 'content') {
selfclosing = false;