2018-10-24 00:39:02 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-10-07 16:44:45 +08:00
|
|
|
require('../support/test-helper');
|
2017-12-29 02:19:52 +08:00
|
|
|
var TestClient = require('../support/test-client');
|
|
|
|
|
2019-10-22 01:07:24 +08:00
|
|
|
describe('layers filters', function () {
|
2017-12-29 02:19:52 +08:00
|
|
|
const type = 'mapnik';
|
|
|
|
const sql = 'select * from populated_places_simple_reduced';
|
|
|
|
const cartocss = `#points {
|
|
|
|
marker-fill-opacity: 1.0;
|
|
|
|
marker-line-color: #FFF;
|
|
|
|
marker-line-width: 0.5;
|
|
|
|
marker-line-opacity: 1.0;
|
|
|
|
marker-placement: point;
|
|
|
|
marker-type: ellipse;
|
|
|
|
marker-width: 8;
|
|
|
|
marker-fill: red;
|
|
|
|
marker-allow-overlap: true;
|
|
|
|
}`;
|
2019-11-14 03:08:04 +08:00
|
|
|
const cartocssVersion = '3.0.12';
|
2017-12-29 02:19:52 +08:00
|
|
|
const options = {
|
|
|
|
sql,
|
|
|
|
cartocss,
|
2019-11-14 03:08:04 +08:00
|
|
|
cartocss_version: cartocssVersion
|
2017-12-29 02:19:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const mapConfig = {
|
|
|
|
version: '1.6.0',
|
|
|
|
layers: [
|
|
|
|
{
|
|
|
|
type,
|
|
|
|
id: 'layerA',
|
|
|
|
options
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type,
|
|
|
|
id: 'layerB',
|
|
|
|
options
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2019-10-22 01:07:24 +08:00
|
|
|
afterEach(function (done) {
|
2017-12-29 02:19:52 +08:00
|
|
|
if (this.testClient) {
|
|
|
|
this.testClient.drain(done);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
['layerA', 'layerB'].forEach(layer => {
|
|
|
|
it(`should work for individual layer ids: ${layer}`, function (done) {
|
|
|
|
this.testClient = new TestClient(mapConfig);
|
|
|
|
this.testClient.getTile(0, 0, 0, { layers: layer }, done);
|
|
|
|
});
|
|
|
|
});
|
2018-10-24 00:39:02 +08:00
|
|
|
});
|