Given coordinates like
South latitude: 50.2
North latitude: 52.01
West longitude: -60
East longitude: -57.1
I want to draw a what should be a bounding box on a orthographic map, but I'm having troubles doing so. I've found a very ellegant way of achieving that in this question, but the solution doesn't seem to work on a newer version, or I am missing something?
Here is the relevent code that I'm using:
const g = svg.append('g')
let bounds = {W: -5.0, N: 50.0, E: 10.0, S: 40.0 };
let projection = projections[1].value.precision(0.1);
let pathGenerator = d3.geoPath(projection);
let arc = d3.geoGraticule().extentMajor([[bounds.W, bounds.S], [bounds.E, bounds.N]]);
function drawBox(params) {
g.selectAll('.rect')
.enter().append('path')
.attr('class', 'rect')
.attr('d', pathGenerator(arc.outline()))
}
Here is a live demo
expected result