block by emeeks fe52c25d4bb0b5ac4baa

Zoom to Bounding Box - d3.carto.map

Full Screen

Zoom to bounding box example for d3.carto.map.

Click on any country and the map will automatically zoom to the bounding box of that country. This is done by creating an invisible vector layer that’s overlaid on the tile layer, with zoomTo being called on click of any of the invisible paths.

index.html

d3map.css

example.css