allow any values to be used in the text renderer

This commit is contained in:
Stuart Lynn 2015-09-14 11:27:51 -04:00
parent a47279e11a
commit a27e8f88ff

View File

@ -139,8 +139,7 @@ var Filters = require('./torque_filters');
var prof = Profiler.metric('torque.renderer.point.generateSprite').start();
var values = {}
if(value.length ==0){
if(value.length ==1){
values["value"] = value[0]
}
else{
@ -212,7 +211,11 @@ var Filters = require('./torque_filters');
}
if(st['text-name']){
st['text-name'] = st['text-name'].replace("{{value}}",value)
var captures = st['text-name'].match(/\{\{(.*)\}\}/)
captures.slice(1,captures.length).forEach(function(rep){
st['text-name'] = st['text-name'].replace("{{"+rep+"}}", values[rep])
})
// st['text-name'] = st['text-name'].replace("{{value}}",value)
cartocss.renderText(ctx,st)
}