From 175b25c7b88cdffdc8f7281097a04da57cad007f Mon Sep 17 00:00:00 2001 From: javi Date: Tue, 10 Jun 2014 17:44:56 +0200 Subject: [PATCH] fixed updating steps when sql changes in windshaft provider --- NEWS | 2 ++ lib/torque/core.js | 10 ++++++++++ lib/torque/gmaps/torque.js | 2 +- lib/torque/leaflet/torque.js | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 0af32e8..a7553f5 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ 2.4.01 - fixed rectangle anchor and size #42 - fixed on method in torque.Event + - fixed problem updating steps when sql change in windshaft provider + 2.4.00 - May/22/2014 - Changed date parsing for windshaft provider - Optimized tile loading diff --git a/lib/torque/core.js b/lib/torque/core.js index 79c9623..40d73f6 100644 --- a/lib/torque/core.js +++ b/lib/torque/core.js @@ -39,6 +39,16 @@ }; exports.torque.Event = Event; + exports.torque.extend = function(a, b) { + for (var k in b) { + a[k] = b[k]; + } + return a + } + + exports.torque.clone = function(a) { + return exports.torque.extend({}, a); + } // types diff --git a/lib/torque/gmaps/torque.js b/lib/torque/gmaps/torque.js index 5becba4..1fba1ed 100644 --- a/lib/torque/gmaps/torque.js +++ b/lib/torque/gmaps/torque.js @@ -30,7 +30,7 @@ function GMapsTorqueLayer(options) { if(self.key !== k) { self.setKey(k); } - }, this.options); + }, torque.clone(this.options)); this.play = this.animator.start.bind(this.animator); this.stop = this.animator.stop.bind(this.animator); diff --git a/lib/torque/leaflet/torque.js b/lib/torque/leaflet/torque.js index 470f4b2..14edaec 100644 --- a/lib/torque/leaflet/torque.js +++ b/lib/torque/leaflet/torque.js @@ -36,7 +36,7 @@ L.TorqueLayer = L.CanvasLayer.extend({ if(self.key !== k) { self.setKey(k, { direct: true }); } - }, options); + }, torque.clone(options)); this.play = this.animator.start.bind(this.animator); this.stop = this.animator.stop.bind(this.animator);