Merge pull request #304 from CartoDB/avoid-uncaught-exception

Avoid uncaught exception 'Error: Image given has not completed loading'
This commit is contained in:
Daniel G. Aubert 2019-03-29 11:05:33 +01:00 committed by GitHub
commit 878d5c418b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,5 @@
language: node_js
node_js:
- '6'
- '8'
- '10'
before_install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi

4
NEWS
View File

@ -1,3 +1,7 @@
3.0.0 (2019-03-dd)
- Drop support for Node.js 6 and 8
- Handle exception: Image given has not completed loading
2.17.1 (2019-01-23)
- Upgrade deps:
- turbo-carto@0.21.1

View File

@ -250,7 +250,15 @@ var CartoDatasource = require('./datasource');
var frame = layer.frames()[fr];
var fr_sprites = sprites[frame] || (sprites[frame] = []);
for (var k = 0, len = keys.length; k < len; k++) {
this._renderTile(tile, keys[k] - frame, frame, fr_sprites, layer);
try {
this._renderTile(tile, keys[k] - frame, frame, fr_sprites, layer);
} catch (error) {
if (callback) {
return callback(error);
}
throw new Error(error);
}
}
}
}
@ -338,7 +346,7 @@ var CartoDatasource = require('./datasource');
if (sp) {
var x = tile.x[posIdx]- (sp.width >> 1) + anchor;
var y = tileMax - tile.y[posIdx] + anchor; // flip mercator
ctx.drawImage(sp, x, y - (sp.height >> 1));
ctx.drawImage(sp, x, y - (sp.height >> 1));
}
}
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "torque.js",
"version": "2.17.1",
"version": "3.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "torque.js",
"version": "2.17.1",
"version": "3.0.0",
"description": "Temporal mapping for CARTO",
"repository": {
"type": "git",