Skip to content

Instantly share code, notes, and snippets.

@VictorVelarde
Last active October 22, 2018 10:40
Show Gist options
  • Save VictorVelarde/5ddfb6cd883bf3503fcfca1186b2248b to your computer and use it in GitHub Desktop.
Save VictorVelarde/5ddfb6cd883bf3503fcfca1186b2248b to your computer and use it in GitHub Desktop.
carto vl - template
<!DOCTYPE html>
<html>
<head>
<title>carto-vl</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
<script src="https://libs.cartocdn.com/carto-vl/v0.9.1/carto-vl.min.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
height: 100%;
width: 100%;
z-index: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// Basemap
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.voyager,
center: [0, 30],
zoom: 2
});
const nav = new mapboxgl.NavigationControl();
map.addControl(nav, 'top-left');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment