Skip to main content
100%

Map Pan & Zoom II

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 7, 2014

This example demonstrates interactive pan and zoom on a world map using a dynamic Mercator projection. The map renders country landmasses as black paths, with white boundaries and a light gray sphere background, all within an SVG element. Using the `d3.behavior.zoom` API, user drag or scroll actions trigger reprojection and redraw the geospatial data via `d3.geo.path`. The underlying geographic data is loaded as JSON from a gist, and the projection translates and scales dynamically with each zoom event.

AI-generated description

This example uses d3.behavior.zoom with a dynamic projection for map panning and zooming. This approach is slower than using a transform or transforming pre-projected geometry because it requires reprojecting whenever the zoom changes.

gpl-3.0 Licensed

Similar vizzes