Overviews adapter with getMapConfig interface

This commit is contained in:
Raul Ochoa
2016-05-23 15:52:31 +02:00
parent 9f6ce64a31
commit 6ccdb6cefd
4 changed files with 23 additions and 18 deletions
@@ -33,8 +33,13 @@ describe('MapConfigOverviewsAdapter', function() {
}
};
mapConfigOverviewsAdapter.getLayers('localhost', [layer_without_overviews], [], function(err, layers) {
var _mapConfig = {
layers: [layer_without_overviews]
};
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, [], function(err, mapConfig) {
assert.ok(!err);
var layers = mapConfig.layers;
assert.equal(layers.length, 1);
assert.equal(layers[0].type, 'cartodb');
assert.equal(layers[0].options.sql, sql);
@@ -52,7 +57,7 @@ describe('MapConfigOverviewsAdapter', function() {
var sql = 'SELECT * FROM test_table_overviews';
var cartocss = '#layer { marker-fill: black; }';
var cartocss_version = '2.3.0';
var layer_without_overviews = {
var layer_with_overviews = {
type: 'cartodb',
options: {
sql: sql,
@@ -61,8 +66,13 @@ describe('MapConfigOverviewsAdapter', function() {
}
};
mapConfigOverviewsAdapter.getLayers('localhost', [layer_without_overviews], [], function(err, layers) {
var _mapConfig = {
layers: [layer_with_overviews]
};
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, [], function(err, mapConfig) {
assert.ok(!err);
var layers = mapConfig.layers;
assert.equal(layers.length, 1);
assert.equal(layers[0].type, 'cartodb');
assert.equal(layers[0].options.sql, sql);