Fix per-layer date wrapping
This commit is contained in:
@@ -4,7 +4,7 @@ const dateWrapper = require('../../../utils/date-wrapper');
|
||||
/**
|
||||
* This middleware wraps the layer query transforming the date fields into numbers because mvt tiles
|
||||
* doesnt support dates as primitive type.
|
||||
*
|
||||
*
|
||||
* - This middleware is ONLY activated when the `dates_as_numbers` option is enabled for some layer in the mapConfig.
|
||||
*/
|
||||
class VectorMapConfigAdapter {
|
||||
@@ -28,6 +28,9 @@ class VectorMapConfigAdapter {
|
||||
}
|
||||
|
||||
_wrapLayer(layer, user) {
|
||||
if (!layer.options.dates_as_numbers) {
|
||||
return Promise.resolve(layer);
|
||||
}
|
||||
const originalQuery = layer.options.sql;
|
||||
return this._getColumns(user, originalQuery)
|
||||
.then(result => {
|
||||
|
||||
Reference in New Issue
Block a user