Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
San Silvestre Tarragona 2015 - CartoDB
<!DOCTYPE html>
<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"/>
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
<link rel="stylesheet" href="" />
<div id="map"></div>
<!-- include cartodb.js library -->
<script src=""></script>
function main() {
cartodb.createVis('map', '', {
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].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) {
window.onload = main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment