Skip to main content
100%

Leaflet multilayer example | CartoDB.js

✓ Published0🌍 Public
Aandrewxhill
Last edited May 28, 2014
Created on May 28, 2014

A gallery of small, synchronized Leaflet maps displays each country from the Natural Earth dataset in its own bounding box, with the target country highlighted in red. Using CartoDB.js, the code executes a SQL query to fetch country extents, then creates a separate map per row and applies CartoCSS styling to emphasize the selected polygon. Hover interactions fetch simplified GeoJSON geometries via `cartodb.SQL` and dynamically add or remove highlight layers using Leaflet’s `L.GeoJSON.geometryToLayer` and `featureOver`/`featureOut` events.

AI-generated description

Similar vizzes