diff --git a/lib/torque/renderer/point.js b/lib/torque/renderer/point.js index 0451076..f2a4a86 100644 --- a/lib/torque/renderer/point.js +++ b/lib/torque/renderer/point.js @@ -83,6 +83,8 @@ var carto = global.carto || require('carto'); // setCartoCSS: function(cartocss) { // clean sprites + this._getIcons(cartocss); + console.log(this._iconNames); this.setShader(new carto.RendererJS().render(cartocss)); }, @@ -256,6 +258,17 @@ var carto = global.carto || require('carto'); } return positions; }, + _getIcons: function(cartocss){ + var re = /marker-file.*\)/g; + this._iconNames = cartocss.match(re).map(function(element){ + element = element.replace("url(", "") + .replace(")", "") + .replace(";", "") + .replace("marker-file:", "") + .trim(); + return element; + }); + }, // return the value for x, y (tile coordinates) // null for no value @@ -292,7 +305,7 @@ var carto = global.carto || require('carto'); return null; } - }; + }); // exports public api