This commit is contained in:
Stuart Lynn 2015-09-09 10:38:37 -04:00
parent b24b4b0db9
commit a2f7ce04ea
4 changed files with 42 additions and 18 deletions

10
dist/torque.full.js vendored

File diff suppressed because one or more lines are too long

View File

@ -4557,7 +4557,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256; this.TILE_SIZE = 256;
this._style = null; this._style = null;
this._gradients = {}; this._gradients = {};
this._forcePoints = false; this._forcePoints = false;
} }
@ -4639,6 +4639,18 @@ var Filters = require('./torque_filters');
var st = shader.getStyle({ var st = shader.getStyle({
value: value value: value
}, shaderVars); }, shaderVars);
var processingVars = {}
for(var key in shaderVars){ processingVars[key]= shaderVars[key]}
processingVars.value = value
var varsToProcess = ['marker-width', 'marker-fill-opacity', 'marker-fill', 'marker-stroke']
varsToProcess.forEach(function(key){
if(st[key]){
st[key] = this.processScaleFunction(st[key], processingVars)
}
}.bind(this))
if(this._style === null || this._style !== st){ if(this._style === null || this._style !== st){
this._style = st; this._style = st;
} }
@ -4689,7 +4701,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL(); i.src = canvas.toDataURL();
return i; return i;
} }
return canvas; return canvas;
}, },
@ -4717,7 +4729,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
return callback && callback(null); return callback && callback(null);
@ -4761,7 +4773,7 @@ var Filters = require('./torque_filters');
}, },
// //
// renders a tile in the canvas for key defined in // renders a tile in the canvas for key defined in
// the torque tile // the torque tile
// //
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) { _renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -4798,7 +4810,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
}, },
@ -4949,7 +4961,7 @@ var Filters = require('./torque_filters');
} }
gradient = {}; gradient = {};
var colorize = this._style['image-filters'].args; var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length; var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){ for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment; var key = increment * i + increment;

2
dist/torque.js vendored

File diff suppressed because one or more lines are too long

View File

@ -4564,7 +4564,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256; this.TILE_SIZE = 256;
this._style = null; this._style = null;
this._gradients = {}; this._gradients = {};
this._forcePoints = false; this._forcePoints = false;
} }
@ -4646,6 +4646,18 @@ var Filters = require('./torque_filters');
var st = shader.getStyle({ var st = shader.getStyle({
value: value value: value
}, shaderVars); }, shaderVars);
var processingVars = {}
for(var key in shaderVars){ processingVars[key]= shaderVars[key]}
processingVars.value = value
var varsToProcess = ['marker-width', 'marker-fill-opacity', 'marker-fill', 'marker-stroke']
varsToProcess.forEach(function(key){
if(st[key]){
st[key] = this.processScaleFunction(st[key], processingVars)
}
}.bind(this))
if(this._style === null || this._style !== st){ if(this._style === null || this._style !== st){
this._style = st; this._style = st;
} }
@ -4696,7 +4708,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL(); i.src = canvas.toDataURL();
return i; return i;
} }
return canvas; return canvas;
}, },
@ -4724,7 +4736,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
return callback && callback(null); return callback && callback(null);
@ -4768,7 +4780,7 @@ var Filters = require('./torque_filters');
}, },
// //
// renders a tile in the canvas for key defined in // renders a tile in the canvas for key defined in
// the torque tile // the torque tile
// //
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) { _renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -4805,7 +4817,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
}, },
@ -4956,7 +4968,7 @@ var Filters = require('./torque_filters');
} }
gradient = {}; gradient = {};
var colorize = this._style['image-filters'].args; var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length; var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){ for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment; var key = increment * i + increment;