Skip to content

Instantly share code, notes, and snippets.

@javisantana
Created October 10, 2012 17:07
Show Gist options
  • Save javisantana/3866966 to your computer and use it in GitHub Desktop.
Save javisantana/3866966 to your computer and use it in GitHub Desktop.
new cartob.js interface
function main() {
var map = L.map('map').setView([0, 0], 3);
L.tileLayer('http://a.tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'stamen'
}).addTo(map);
cartodb.loadLayer(map, {
user: 'development',
table: 'clubbing',
}).on('done', function(layer) {
layer.on('featureOver', function(e, pos, latlng, feature_info) {
console.log(e, pos, latlng, feature_info);
})
}).on('error', function() {
console.log("some error occurred");
});
}
document.body.onload = main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment