Created
January 5, 2015 15:35
-
-
Save juanramon/fa8484dc281375d228ee to your computer and use it in GitHub Desktop.
San Silvestre Tarragona 2015 - CartoDB
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>San Silvestre Tarragona 2014</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/3.11/themes/css/cartodb.css" /> | |
</head> | |
<body> | |
<div id="map"></div> | |
<!-- include cartodb.js library --> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/3.11/cartodb.js"></script> | |
<script> | |
function main() { | |
cartodb.createVis('map', 'http://juanramon.cartodb.com/api/v2/viz/d3f53e04-94e7-11e4-9be9-0e4fddd5de28/viz.json', { | |
shareable: false, | |
title: true, | |
description: false, | |
search: false, | |
tiles_loader: true, | |
center_lat: 41.1100114129846, | |
center_lon: 1.247248649597168, | |
zoom: 15, | |
time_slider: false, | |
scrollwheel: false | |
}) | |
.done(function(vis, layers) { | |
// layer 0 is the base layer, layer 1 is cartodb layer | |
// setInteraction is disabled by default | |
layers[1].setInteraction(true); | |
layers[1].on('featureOver', function(e, pos, latlng, data) { | |
cartodb.log.log(e, pos, latlng, data); | |
}); | |
// you can get the native map to work with it | |
var map = vis.getNativeMap(); | |
// now, perform any operations you need | |
// map.setZoom(3); | |
// map.panTo([50.5, 30.5]); | |
}) | |
.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