fixed rendering when variables were used

This commit is contained in:
javi 2013-11-25 16:36:53 +01:00
parent 2dcbacd763
commit ed705f1a90
3 changed files with 3 additions and 2 deletions

View File

@ -172,6 +172,7 @@
return {
x: x,
y: y,
z: zoom,
coord: {
x: coord.x,
y: coord.y,

View File

@ -135,7 +135,7 @@
if(c) {
var sp = sprites[c];
if(!sp) {
sp = sprites[c] = this.generateSprite(shader, c, _.extend({ zoom: tile.zoom, 'frame-offset': frame_offset }, shaderVars));
sp = sprites[c] = this.generateSprite(shader, c, _.extend({ zoom: tile.z, 'frame-offset': frame_offset }, shaderVars));
}
//var x = tile.x[posIdx]*res - (sp.width >> 1);
//var y = (256 - res - res*tile.y[posIdx]) - (sp.height >> 1);

2
vendor/carto.js vendored
View File

@ -4815,7 +4815,7 @@ tree.Value.prototype.toJS = function() {
v = "'" + v + "'";
} else if (val.is === 'field') {
// replace [varuable] by ctx['variable']
v = v.replace(/\[(.*)\]/g, "ctx['\$1']")
v = v.replace(/\[(.*)\]/g, "data['\$1']")
}
return "_value = " + v + ";";
};