Add torque to CDN

This commit is contained in:
Ivan Malagon 2018-11-21 18:17:47 +01:00
parent ce414701ab
commit 4c813aa12a
8 changed files with 922 additions and 2033 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.swp
node_modules
test/dist/suite-bundle.js
secrets.js

36
dist/torque.full.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

8
dist/torque.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**
Torque 2.16.3
Torque 2.16.5
Temporal mapping for CARTO
https://github.com/cartodb/torque
**/
@ -1635,6 +1635,8 @@ function GMapsTorqueLayer(options) {
this.hidden = !this.options.visible;
this.showLimitErrors = options.showLimitErrors;
this.animator = new torque.Animator(function(time) {
var k = time | 0;
if(self.getKey() !== k) {
@ -6093,7 +6095,7 @@ var CartoDatasource = require('./datasource');
this._shader = shader;
this._Map = this._shader.getDefault().getStyle({}, { zoom: 0 });
var img_names = this._shader.getImageURLs();
if (this.layer.showLimitErrors) {
if (this.layer && this.layer.showLimitErrors) {
img_names.push(ERROR_IMG_URL);
}

View File

@ -27,6 +27,7 @@
"dependencies": {
"carto": "cartodb/carto#master",
"d3": "3.5.17",
"s3": "4.4.0",
"turbo-carto": "0.19.0",
"turf-jenks": "~1.0.1"
},

34
s3.js Normal file
View File

@ -0,0 +1,34 @@
var s3 = require('s3');
var version = require('./package.json').version;
var secrets = require('./secrets');
var options = {
s3Options: {
accessKeyId: secrets.s3.accessKeyId,
secretAccessKey: secrets.s3.secretAccessKey
}
};
console.log('version', version);
console.log('secrets', secrets);
var params = {
localDir: 'dist',
s3Params: {
Bucket: secrets.s3.bucket,
Prefix: 'torque.js/' + version + '/',
ACL: 'public-read'
}
};
var client = s3.createClient(options);
var uploader = client.uploadDir(params);
uploader.on('error', function (err) {
console.error('unable to sync', err.stack);
});
uploader.on('progress', function() {
console.log("progress", uploader.progressAmount, uploader.progressTotal);
});
uploader.on('end', function() {
console.log("done uploading");
});

7
secrets.example.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = {
s3: {
bucket: '',
accessKeyId: '',
secretAccessKey: ''
}
};