Merge pull request #304 from CartoDB/avoid-uncaught-exception
Avoid uncaught exception 'Error: Image given has not completed loading'
This commit is contained in:
commit
878d5c418b
@ -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
4
NEWS
@ -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
|
||||
|
@ -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
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "torque.js",
|
||||
"version": "2.17.1",
|
||||
"version": "3.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "torque.js",
|
||||
"version": "2.17.1",
|
||||
"version": "3.0.0",
|
||||
"description": "Temporal mapping for CARTO",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
Reference in New Issue
Block a user