diff --git a/lib/carto/renderer_js.js b/lib/carto/renderer_js.js index ae840c4..ac4fea5 100644 --- a/lib/carto/renderer_js.js +++ b/lib/carto/renderer_js.js @@ -57,7 +57,7 @@ CartoCSS.Layer.prototype = { }, /** - * return the symbolizers that need to be rendered with + * return the symbolizers that need to be rendered with * this style. The order is the rendering order. * @returns a list with 3 possible values 'line', 'marker', 'polygon' */ @@ -99,7 +99,7 @@ CartoCSS.Layer.prototype = { // // given a geoemtry type returns the transformed one acording the CartoCSS - // For points there are two kind of types: point and sprite, the first one + // For points there are two kind of types: point and sprite, the first one // is a circle, second one is an image sprite // // the other geometry types are the same than geojson (polygon, linestring...) @@ -209,12 +209,6 @@ CartoCSS.prototype = { var value = rule.value.value[0].value[0].value.value; this.imageURLs.push(value); } - - rule.toXML(parse_env, {}); - } - - if (this.options.strict && parse_env.errors.message) { - throw new Error(parse_env.errors.message); } layer.frames = []; @@ -244,6 +238,13 @@ CartoCSS.prototype = { var done = {}; for(var i = 0; i < defs.length; ++i) { var def = defs[i]; + + def.toXML(parse_env, {}); + + if (this.options.strict && parse_env.errors.message) { + throw new Error(parse_env.errors.message); + } + var k = defKey(def); var layer = layers[k]; if(!done[k]) {