Created
July 17, 2014 10:40
-
-
Save iriberri/1310e871f8407e4d5317 to your computer and use it in GitHub Desktop.
CartoDB.js visualisation options
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
<html> | |
<head> | |
<title>CartoDB.js</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<style> | |
html, body, #map { | |
height: 100%; | |
padding: 0; | |
margin: 0; | |
} | |
</style> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" /> | |
</head> | |
<body> | |
<div id="map" style="height: 400px; width:400px"></div> | |
<!-- include cartodb.js library --> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script> | |
<script> | |
function main() { | |
cartodb.createVis('map', 'http://iriberri.cartodb.com/api/v2/viz/xxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx/viz.json', { | |
center_lat: 43.90, | |
center_lon: -97.55, | |
zoom: 5 | |
}) | |
.done(function(vis, layers) { | |
layers[1].setInteraction(true); | |
layers[1].on('featureOver', function(e, pos, latlng, data) { | |
cartodb.log.log(e, pos, latlng, data); | |
}); | |
map = vis.getNativeMap(); | |
}) | |
.error(function(err) { | |
console.log(err); | |
}); | |
} | |
window.onload = main; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment