Replace underscore defaults/extend with torque ones
This commit is contained in:
parent
936bfe227a
commit
e8634abc0d
@ -21,11 +21,11 @@
|
||||
this._t0 = +new Date();
|
||||
this.callback = callback;
|
||||
this._time = 0.0;
|
||||
_.defaults(this.options, {
|
||||
animationDelay: 0,
|
||||
maxDelta: 0.2,
|
||||
loop: true
|
||||
});
|
||||
this.options = torque.extend({
|
||||
animationDelay: 0,
|
||||
maxDelta: 0.2,
|
||||
loop: true
|
||||
}, this.options);
|
||||
|
||||
this.rescale();
|
||||
|
||||
|
@ -10,16 +10,16 @@ function GMapsTorqueLayer(options) {
|
||||
this.key = 0;
|
||||
this.shader = null;
|
||||
this.ready = false;
|
||||
this.options = _.extend({}, options);
|
||||
_.defaults(this.options, {
|
||||
this.options = torque.extend({}, options);
|
||||
this.options = torque.extend({
|
||||
provider: 'windshaft',
|
||||
renderer: 'point',
|
||||
resolution: 2,
|
||||
steps: 100,
|
||||
visible: true
|
||||
});
|
||||
}, this.options);
|
||||
if (options.cartocss) {
|
||||
_.extend(this.options,
|
||||
torque.extend(this.options,
|
||||
torque.common.TorqueLayer.optionsFromCartoCSS(options.cartocss));
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ function GMapsTorqueLayer(options) {
|
||||
/**
|
||||
* torque layer
|
||||
*/
|
||||
GMapsTorqueLayer.prototype = _.extend({},
|
||||
GMapsTorqueLayer.prototype = torque.extend({},
|
||||
CanvasLayer.prototype,
|
||||
torque.GMapsTileLoader.prototype,
|
||||
torque.Event,
|
||||
@ -266,7 +266,7 @@ GMapsTorqueLayer.prototype = _.extend({},
|
||||
if(this.provider && this.provider.setOptions(options)) {
|
||||
this._reloadTiles();
|
||||
}
|
||||
_.extend(this.options, options);
|
||||
torque.extend(this.options, options);
|
||||
|
||||
// animator options
|
||||
if (options.animationDuration) {
|
||||
@ -293,12 +293,12 @@ GMapsTorqueLayer.prototype = _.extend({},
|
||||
|
||||
|
||||
function GMapsTiledTorqueLayer(options) {
|
||||
this.options = _.extend({}, options);
|
||||
this.options = torque.extend({}, options);
|
||||
CanvasTileLayer.call(this, this._loadTile.bind(this), this.drawTile.bind(this));
|
||||
this.initialize(options);
|
||||
}
|
||||
|
||||
GMapsTiledTorqueLayer.prototype = _.extend({}, CanvasTileLayer.prototype, {
|
||||
GMapsTiledTorqueLayer.prototype = torque.extend({}, CanvasTileLayer.prototype, {
|
||||
|
||||
providers: {
|
||||
'sql_api': torque.providers.json,
|
||||
|
@ -24,7 +24,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this.key = 0;
|
||||
this.prevRenderedKey = 0;
|
||||
if (options.cartocss) {
|
||||
_.extend(options, torque.common.TorqueLayer.optionsFromCartoCSS(options.cartocss));
|
||||
torque.extend(options, torque.common.TorqueLayer.optionsFromCartoCSS(options.cartocss));
|
||||
}
|
||||
|
||||
options.resolution = options.resolution || 2;
|
||||
@ -317,7 +317,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this._reloadTiles();
|
||||
}
|
||||
|
||||
_.extend(this.options, options);
|
||||
torque.extend(this.options, options);
|
||||
|
||||
// animator options
|
||||
if (options.animationDuration) {
|
||||
|
Loading…
Reference in New Issue
Block a user