Last active
December 18, 2015 14:29
-
-
Save javisantana/5797542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cartodb.createLayer(map, 'viz.json').done(function(layer) { | |
map.addLayer(layer); | |
var countries = layer.getSubLayer(0); | |
countries.setSQL('select * from countries'); | |
var places = layer.createSubLayer({ | |
sql: "select * from populated_places", | |
cartocss: "#layer { marker-fill: red; }" | |
}) | |
setTimeout(function() { | |
places.remove(); | |
}, 10000); | |
}); | |
// creating a map without viz.json | |
cartodb.createLayer(map, { | |
type: 'cartodb', | |
layers: [{ | |
sql: '....', | |
cartocss: '....' | |
}] | |
}).done(function(layer) { | |
leaflet.addLayer(layer) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment