Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<title>Add layer | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
<script src=""></script>
<!-- Include Mapbox GL JS -->
<script src=""></script>
<!-- Include Mapbox GL CSS -->
<link href="" rel="stylesheet" />
html, body {
margin: 0;
#map {
position: absolute;
width: 100%;
height: 100%;
<div id="map"></div>
const map = new mapboxgl.Map({
container: 'map',
style: '',
center: [-73.9776471574288, 40.747726378340275],
zoom: 14.136499129338478,
dragRotate: false,
touchZoomRotate: false
serverURL: 'https://{user}'
user: 'dmanzanares',
apiKey: 'default_public'
const source = new carto.source.Dataset("mnmappluto");
const viz = new carto.Viz(`color: ramp(linear(log($numfloors), 1, 4), Earth)
const layer = new carto.Layer('layer', source, viz);
layer.addTo(map, 'watername_ocean');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment