-
-
Save juanignaciosl/7dd5d2ace765d5652d0c to your computer and use it in GitHub Desktop.
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, height=device-height, target-densitydpi=device-dpi, initial-scale=1" /> <!-- para bootstrap --> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" /> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.css' rel='stylesheet' /> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-draw/v0.2.2/leaflet.draw.css' rel='stylesheet' /> | |
<script type="text/javascript" src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script> | |
<script type="text/javascript" src='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.js'></script> | |
<script type="text/javascript" src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-draw/v0.2.2/leaflet.draw.js'></script> | |
<script type="text/javascript"> | |
function createMap() { | |
var mapCenter = L.latLng(40.42, -3.0); | |
map = new L.Map('mapCanvas', { | |
center: mapCenter, | |
zoom: 6 | |
}); | |
sql = new cartodb.SQL({ user: 'carlostoquero' }); | |
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { | |
attribution: '© OpenStreetMap contributors, © CartoDB' | |
}).addTo(map); | |
cartodb.createLayer(map, 'https://carlostoquero.cartodb.com/api/v2/viz/f8aeb51c-e8fd-11e4-8f45-0e0c41326911/viz.json', { infowindow: false }) | |
.addTo(map) | |
.on('done', function (layer) { | |
// polygonLayer = layer; | |
// layer.setInteraction(true); | |
// layer.setInteractivity('cartodb_id, nameunit'); | |
// layer.on('featureClick', function(e, pos, latlng, data) { | |
// showSelectionPolygon(data.cartodb_id, data.nameunit); | |
// }); | |
cartodb.log.log("map correctly loaded"); | |
}).on('error', function () { | |
cartodb.log.log("some error occurred"); | |
}); | |
} | |
window.onload = createMap; | |
</script> | |
</head> | |
<body> | |
<div id="pagina" class="container-fluid" style="padding-right: 0px; " > | |
<!-- Content --> | |
<div id="content" style="margin-left: 0px;height:93vh;"> | |
<div id="mapCanvas" class="map pull-center" style="clear: right; display: block; margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto;height: 100vh;"> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment