diff --git a/lib/torque/animator.js b/lib/torque/animator.js index ac74952..c8f1800 100644 --- a/lib/torque/animator.js +++ b/lib/torque/animator.js @@ -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(); diff --git a/lib/torque/gmaps/torque.js b/lib/torque/gmaps/torque.js index 49c15f8..f37407a 100644 --- a/lib/torque/gmaps/torque.js +++ b/lib/torque/gmaps/torque.js @@ -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, diff --git a/lib/torque/leaflet/torque.js b/lib/torque/leaflet/torque.js index 31fcdef..7c82e86 100644 --- a/lib/torque/leaflet/torque.js +++ b/lib/torque/leaflet/torque.js @@ -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) {