Skip to main content
100%

Responsive map

✓ Published0🌍 Public
LLucaZampieri
Last edited Dec 4, 2017
Created on Dec 4, 2017

This responsive map adapts its display based on the browser window’s width, showing a stamen toner tile layer overlaid with data fetched from a CartoDB visualization JSON. It uses the CartoDB.js library (`L.Map`, `L.tileLayer`) and Leaflet’s resize event to switch between two preset height and zoom combinations: a taller 650-pixel view with zoom level 8 for wide windows, and a shorter 300-pixel view with zoom level 7 for narrow ones, all driven by a breakpoint at 720 pixels.

AI-generated description

CartoDB/Leaflet map that adapts map dimensions (height) and zoom level based on map width. Open in new window and resize to view responsiveness.

forked from <a href='http://bl.ocks.org/maartenzam/'>maartenzam</a>'s block: <a href='http://bl.ocks.org/maartenzam/7ef773bdf11999c9eebb'>Responsive map with Cartodb/Leaflet</a>

mit Licensed

Similar vizzes