simply cases of mvt property type changes

This commit is contained in:
Simon Martín
2018-04-12 10:46:21 +02:00
parent 67411e32ff
commit 4978dd86ac
+28 -1
View File
@@ -100,7 +100,7 @@ describe('MVT Mapnik', function () {
{
type: 'cartodb',
options: {
sql: 'select * from countries_null_values',
sql: "select ldc, cartodb_id, _2016_6_partcntry, the_geom_webmercator, country from countries_null_values where country = 'Kenya' OR country = 'Sudan' LIMIT 3",
}
}
]
@@ -143,4 +143,31 @@ describe('MVT Mapnik', function () {
})
.catch(err => done(err));
});
it('should not convert boolean to numeric', function (done) {
const geomWebmercator = 'st_transform(st_setsrid(st_makepoint(10, 10), 4326), 3857) as the_geom_webmercator';
const sql = `SELECT ${geomWebmercator}, FALSE as status, 0 as data`;
const mapConfig = {
version: '1.7.0',
layers: [
{
type: 'cartodb',
options: { sql }
}
]
};
this.testClient = new TestClient(mapConfig);
this.testClient.getTile(0, 0, 0, { format: 'mvt', layer: 0 }, (err, res, MVT) => {
if (err) {
return done(err);
}
const geojsonTile = JSON.parse(MVT.toGeoJSONSync(0));
assert.strictEqual(geojsonTile.features[0].properties.status, false);
assert.strictEqual(geojsonTile.features[0].properties.data, undefined);
done();
});
});
});