Welcome to Advanced Interactive Web Mapping, Programming, and Design, Class 9
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Class 9
$.getJSON(), you can add a done callbackcartodb.createVis(...)
.done(function (vis, layers) {
console.log('vis loaded!');
});layers is an array of layers, the first one is the base mapcartodb.createVis(...)
.done(function (vis, layers) {
layers[1].hide();
});layers[1] is all the visualization layersgetSubLayer()layers won't be available outside of createVis().done()var <your_sublayer_name> somewhere before createVis().done()getNativeMap()createVis()
.done()