don't render when hidden
This commit is contained in:
parent
f08fe5bc48
commit
79becc8ae1
@ -86,14 +86,18 @@ GMapsTorqueLayer.prototype = _.extend({},
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if(this.hidden) return this;
|
||||
this.pause();
|
||||
this.clear();
|
||||
this.hidden = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if(!this.hidden) return this;
|
||||
this.hidden = false;
|
||||
this.play();
|
||||
return this;
|
||||
},
|
||||
|
||||
setSQL: function(sql) {
|
||||
|
@ -71,14 +71,18 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if(this.hidden) return this;
|
||||
this.pause();
|
||||
this.clear();
|
||||
this.hidden = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if(!this.hidden) return this;
|
||||
this.hidden = false;
|
||||
this.play();
|
||||
return this;
|
||||
},
|
||||
|
||||
setSQL: function(sql) {
|
||||
@ -121,6 +125,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
* requestAnimationFrame. Use redraw to refresh it
|
||||
*/
|
||||
render: function() {
|
||||
if(this.hidden) return;
|
||||
var t, tile, pos;
|
||||
var canvas = this.getCanvas();
|
||||
canvas.width = canvas.width;
|
||||
|
Loading…
Reference in New Issue
Block a user