commit
8259271184
@ -59,7 +59,7 @@ module.exports = class AggregationMapConfig extends MapConfig {
|
||||
threshold = AggregationMapConfig.THRESHOLD,
|
||||
placement = AggregationMapConfig.PLACEMENT,
|
||||
columns = {},
|
||||
dimmensions = {}
|
||||
dimensions = {}
|
||||
} = this.getAggregation(index);
|
||||
|
||||
return aggregationQuery({
|
||||
@ -68,7 +68,7 @@ module.exports = class AggregationMapConfig extends MapConfig {
|
||||
threshold,
|
||||
placement,
|
||||
columns,
|
||||
dimmensions
|
||||
dimensions
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -529,6 +529,46 @@ describe('aggregation', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('when dimensions is provided should return a tile returning the column used as dimensions',
|
||||
function (done) {
|
||||
|
||||
// FIXME: skip until pg-mvt renderer is able to return all columns
|
||||
if (process.env.POSTGIS_VERSION === '2.4') {
|
||||
return done();
|
||||
}
|
||||
|
||||
this.mapConfig = createVectorMapConfig([
|
||||
{
|
||||
type: 'cartodb',
|
||||
options: {
|
||||
sql: POINTS_SQL_1,
|
||||
aggregation: {
|
||||
threshold: 1,
|
||||
dimensions: {
|
||||
value: "value"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
this.testClient = new TestClient(this.mapConfig);
|
||||
const options = {
|
||||
format: 'mvt'
|
||||
};
|
||||
this.testClient.getTile(0, 0, 0, options, (err, res, tile) => {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
|
||||
const tileJSON = tile.toJSON();
|
||||
|
||||
tileJSON[0].features.forEach(feature => assert.equal(typeof feature.properties.value, 'number'));
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should work when the sql has single quotes', function (done) {
|
||||
this.mapConfig = createVectorMapConfig([
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user