Map Pan / Zoom with Cities v6
✓ Published0🌍 Public
Dd3noob
Last edited Sep 14, 2020
Created on Sep 14, 2020
This example shows a Mercator map of the world centered on the Pacific Ocean, with red circles marking eleven cities from a CSV file. Users can pan and zoom the entire map and city markers using the d3.zoom behavior, with a scale extent of 1 to 8. The map is rendered as SVG paths from a TopoJSON file via d3.geoPath, while city positions are projected using d3.geoMercator. Each city circle is wrapped in a link that opens a Google search for that city.
AI-generated descriptionThis is a simple map example with pan and zoom centered on the Pacific.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 6 of d3.js.
mit Licensed