I have tried to figure out why the layer is not showing up on the map. My code is as follows.
var markersLayerSource = {
user_name: 'someaccount',
type: 'cartodb',
sublayers: [{
sql: baseSql,
https: 'force https',
cartocss: cartoCss,
interactivity: 'cartodb_id'
}]
}
cartodb.createLayer(map, markersLayerSource, {https: true})
.addTo(map)
.on('done', function (layer) {
console.log(layer);
layer.getSubLayer(0).setInteraction(true);
layer.getSubLayer(0).on('featureOver', function(e, pos, pixel, data) {
// print data to console log
console.log("Event #" + data.cartodb_id + ", name " + data.name + ", max population: " + data.pop_max);
});
//layer.getSubLayer(0).show();
//cdb.vis.Vis.addInfowindow(map, layer.getSubLayer(0), ['cartodb_id']);
});
Any one with pointers on why i specifically need to have cdb.viv.Vis.addInfowindow inorder for the layer to show up on the map? Am I doing something wrong if one needs to render without the addinfowindow?