fixed provider when there are 0 steps

This commit is contained in:
javi 2013-11-05 17:51:34 +01:00
parent cb722f6b63
commit 96d4e94cc0

View File

@ -253,8 +253,12 @@
var self = this;
this.sql(query, function (data) {
var rows = JSON.parse(data.responseText).rows;
callback(self.proccessTile(rows, coord, zoom));
if (data) {
var rows = JSON.parse(data.responseText).rows;
callback(self.proccessTile(rows, coord, zoom));
} else {
callback(null);
}
});
},
@ -286,6 +290,7 @@
if (this.options.steps !== steps) {
this.options.steps = steps;
this.options.step = (this.options.end- this.options.start)/this.options.steps;
this.options.step = this.options.step || 1;
}
},
@ -340,6 +345,8 @@
self.options.start = data.min;
self.options.end = data.max;
self.options.step = (data.max - data.min)/self.options.steps;
// step can't be 0
self.options.step = self.options.step || 1;
self.options.bounds = [
[data.ymin, data.xmin],
[data.ymax, data.xmax]