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