Use sql as replacement variable
This commit is contained in:
parent
7d4caf6974
commit
3e94e3288f
@ -142,7 +142,7 @@ AnalysisMapConfigAdapter.prototype.getMapConfig = function(analysisConfiguration
|
||||
var analysisSql = layerQuery(layerNode.getQuery(), layerNode.getColumns());
|
||||
var sqlQueryWrap = layer.options.sql_wrap;
|
||||
if (sqlQueryWrap) {
|
||||
analysisSql = sqlQueryWrap.replace(/<%=\s*__analysis_query\s*%>/g, analysisSql);
|
||||
analysisSql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, analysisSql);
|
||||
}
|
||||
layer.options.sql = analysisSql;
|
||||
var layerDataviews = getLayerDataviews(layer, dataviews);
|
||||
|
@ -337,7 +337,7 @@ describe('analysis-layers', function() {
|
||||
"source": {
|
||||
"id": "2570e105-7b37-40d2-bdf4-1af889598745"
|
||||
},
|
||||
"sql_wrap": "SELECT * FROM (<%= __analysis_query %>) __wrapped WHERE adm0cap = 1",
|
||||
"sql_wrap": "SELECT * FROM (<%= sql %>) __wrapped WHERE adm0cap = 1",
|
||||
"cartocss": DEFAULT_MULTITYPE_STYLE,
|
||||
"cartocss_version": "2.3.0"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user