added utility function eval to get the real value for a property

This commit is contained in:
javi 2013-11-18 17:31:18 +01:00
parent 66d7c45a0c
commit fadcb3391d

View File

@ -192,6 +192,11 @@ CartoCSS.Layer.prototype = {
return this.fullName().split('::')[1];
},
eval: function(prop) {
var p = this.shader[prop];
if (!p) return;
return p({}, { zoom: 0, 'frame-offset': 0 });
},
/*
* `target`: style, 'svg', 'canvas-2d'...