From 0f03a5e70ee2f1ea69bc827bc48d2c821879b7b0 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sat, 30 Jan 2021 19:28:03 +0000 Subject: [PATCH] handle view rotation --- examples/d3.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/d3.js b/examples/d3.js index ae6b352f71..921409c77d 100644 --- a/examples/d3.js +++ b/examples/d3.js @@ -50,10 +50,13 @@ class CanvasLayer extends Layer { const scale = r / frameState.viewState.resolution; const center = toLonLat(getCenter(frameState.extent), projection); + const angle = (-frameState.viewState.rotation * 180) / Math.PI; + d3Projection .scale(scale) .center(center) - .translate([width / 2, height / 2]); + .translate([width / 2, height / 2]) + .angle(angle); d3Path = d3Path.projection(d3Projection); d3Path(this.features);