Clipping
There are many ways to clip an area: you can scale a map so that the parts that don't fit in the viewport get clipped out, you can filter out unwanted features and adjust the graticule's extent, or you can perform SVG or Canvas clipping using geometric shapes. There are also two d3-geo methods that perform clipping using map coordinates. The first, clipAngle(), clips the sphere by an angular distance from a center point on the surface before projection,. The second, clipExtent(), clips the projected map using pixel coordinates of a bounding rectangle.
For example, to clip the sphere by a radius of 20 degrees around London, you should configure the projection as follows (Projection-Geometry/7-clipping-small-circle.html):
const projection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access