fixed provider when there are 0 steps
This commit is contained in:
parent
cb722f6b63
commit
96d4e94cc0
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user