Handle limits error in GMaps

This commit is contained in:
rubenmoya 2017-11-07 11:35:17 +01:00
parent e83bcaee6d
commit 5d89990119

View File

@ -180,7 +180,7 @@ GMapsTorqueLayer.prototype = torque.extend({},
// for each tile shown on the map request the data
onTileAdded: function(t) {
var self = this;
this.provider.getTileData(t, t.zoom, function(tileData) {
var successCallback = function (tileData) {
// don't load tiles that are not being shown
if (t.zoom !== self.map.getZoom()) return;
self._tileLoaded(t, tileData);
@ -188,7 +188,12 @@ GMapsTorqueLayer.prototype = torque.extend({},
if (tileData) {
self.redraw();
}
});
};
var errorCallback = function (error) {
self.fire('tileError', error);
}
this.provider.getTileData(t, t.zoom, successCallback, errorCallback);
},
clear: function() {
@ -325,7 +330,7 @@ GMapsTorqueLayer.prototype = torque.extend({},
console.log('Torque layer: CartoCSS style on named maps is read-only');
return false;
}
var shader = new carto.RendererJS().render(cartocss);
this.shader = shader;
if (this.renderer) {
@ -406,7 +411,7 @@ GMapsTorqueLayer.prototype = torque.extend({},
}
return c;
},
getValueForBBox: function(x, y, w, h) {
var xf = x + w, yf = y + h;
var sum = 0;