Skip to main content
100%

Leaflet example | CartoDB.js

✓ Published0🌍 Public
Aandrewxhill
Last edited Sep 24, 2014
Created on Sep 24, 2014

This example combines Leaflet with CartoDB.js to display two CartoDB layers on a Stamen Toner base map, centered on global coordinates. A queue library loads both viz.json layer definitions, then adds them to the map, cycling through visibility states on any body click. The first click hides the first layer, the second hides the second and shows the first, and the third restores both layers. The code uses the Leaflet map API, CartoDB.js `createLayer`, and the D3 queue for asynchronous loading.

AI-generated description

Similar vizzes