Skip to main content
100%

Raster & Vector II

✓ Published0🌍 Public
Mmbostock
Last edited Jul 25, 2019
Created on Apr 9, 2013

A map of the United States uses a red outline to show state boundaries over OpenStreetMap raster tiles. The code combines d3-tile for tile loading, d3.geoMercator and d3.geoPath for reprojecting TopoJSON vectors, and d3-zoom for pan and zoom. On each interaction, the tile set and vector geometry are recomputed rather than relying on a transform, with tiles rendered as SVG images.

AI-generated description

Using d3-tile to display raster image tiles underneath some TopoJSON vectors, and d3-zoom for pan & zoom. This version reprojects the geometry on interaction; compare to updating the transform. See another variation of this example with points, showing the U.S. State Capitals; also see the static version.

Tiles copyright OpenStreetMap contributors.

gpl-3.0 Licensed

Similar vizzes