Trying to recreate an application made in carto v3 in the new version of carto (v4); here is the one which was create using v3. Problem we are running into is that we can't seem to figure out how to create multiple layers in v4, there is no documentation on a similar method like .createLayer()
from v3.
Does anyone have some workable related v4 code I could look at?
function retrieveLayer(map, cartoLayerSource, layerSide) {
return new Promise(function(resolve, reject) {
cartodb.createLayer(map, cartoLayerSource)
.addTo(map)
.on('done',
function(layer) {
// console.log(layer);
layerSides[layerSide] = layer;
resolve("loaded")
})
.on('error', function(error) {
// console.log(error);
});
})
}