dist files

This commit is contained in:
javi 2013-10-31 14:40:01 +01:00
parent 9438f8c9f8
commit 7fad2726ed
2 changed files with 47 additions and 4 deletions

2
dist/torque.js vendored

File diff suppressed because one or more lines are too long

View File

@ -833,7 +833,7 @@ exports.Profiler = Profiler;
url: function() {
var opts = this.options;
var port = opts.sql_api_port;
var domain = (opts.sql_api_domain || (this.options.user + '.cartodb.com')) + (port ? ':' + port: '');
var domain = (opts.user_name + '.' + (opts.sql_api_domain || 'cartodb.com')) + (port ? ':' + port: '');
var protocol = opts.sql_api_protocol || 'http';
return this.options.url || protocol + '://' + domain + '/api/v2/sql';
},
@ -2479,7 +2479,8 @@ function GMapsTorqueLayer(options) {
provider: 'sql_api',
renderer: 'point',
resolution: 2,
steps: 100
steps: 100,
visible: true
});
this.animator = new torque.Animator(function(time) {
@ -2530,6 +2531,7 @@ GMapsTorqueLayer.prototype = _.extend({},
var self = this;
this.onTileAdded = this.onTileAdded.bind(this);
this.hidden = !this.options.visible;
this.options.ready = function() {
self.fire("change:bounds", {
@ -2550,6 +2552,21 @@ 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) {
if (!this.provider || !this.provider.setSQL) {
throw new Error("this provider does not support SQL");
@ -2592,12 +2609,18 @@ GMapsTorqueLayer.prototype = _.extend({},
});
},
clear: function() {
var canvas = this.canvas;
canvas.width = canvas.width;
},
/**
* render the selectef key
* don't call this function directly, it's called by
* requestAnimationFrame. Use redraw to refresh it
*/
render: function() {
if(this.hidden) return;
var t, tile, pos;
var canvas = this.canvas;
canvas.width = canvas.width;
@ -3048,6 +3071,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
options.resolution = options.resolution || 2;
options.steps = options.steps || 100;
options.visible = options.visible === undefined ? true: options.visible;
this.hidden = !options.visible;
this.animator = new torque.Animator(function(time) {
var k = time | 0;
@ -3095,6 +3120,21 @@ L.TorqueLayer = L.CanvasLayer.extend({
this._removeTileLoader();
},
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) {
if (!this.provider || !this.provider.setSQL) {
throw new Error("this provider does not support SQL");
@ -3124,6 +3164,10 @@ L.TorqueLayer = L.CanvasLayer.extend({
return this.provider && this.provider.getKeySpan();
},
clear: function() {
var canvas = this.getCanvas();
canvas.width = canvas.width;
},
/**
* render the selectef key
@ -3131,6 +3175,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;