Skip to main content
100%

Constrained Zoom Map. Centered on the Pacific

✓ Published0🌍 Public
Dd3noob
Last edited Nov 30, 2019
Created on Feb 26, 2013

This example shows a world map centered on the Pacific Ocean, where users can pan and zoom with constrained translation bounds. It uses a Mercator projection with `.rotate([-180,0])` to place the anti-meridian at the center, and renders geographic features from a TopoJSON world dataset using `d3.geo.path`. The zoom behavior relies on `d3.behavior.zoom` and custom logic in the `move` function to limit panning within the viewport. Landmasses are filled black with white boundary strokes, and the SVG overlay captures pointer events for interaction.

AI-generated description

This example is a minor variation on Mike Bostocks zoom constrained map, which demonstrates using the zoom event to constrain the zoom behavior’s translation. However, this version is centered on the anti-meridian (the Pacific).

The centering on a position other thann the prime medidian is accomplished by setting .rotate([-180,0]); as part of the var projection = section.

mit Licensed

Similar vizzes