allow any values to be used in the text renderer
This commit is contained in:
parent
a47279e11a
commit
a27e8f88ff
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user