-
I'm trying to implement a sort of static "zoom" on a I've made a few attempts reusing the Projection domain example by trying to obtain a "bounding-box" approach instead of a circle, but without luck so far. This goes down to my inexperience with D3: a few alternative domains are available, but I haven't been able to make them work. I've also found little or no demo about that on internet. What could be a good way to achieve the "zoom" effect? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Does this example help? |
Beta Was this translation helpful? Give feedback.
-
Yes and no @Fil . This is a good way to zoom into specific countries, like China in the example. What I'm looking for is for the ability to zoom into frames defined by specific lat/lon coordinates. |
Beta Was this translation helpful? Give feedback.
-
Thanks @Fil ! From your suggestion, I've been able to achieve the desired result in this fork of the projection demo. It's easy to spot the "rectangle" projected on a globe. A side question: in the original example the demo used |
Beta Was this translation helpful? Give feedback.
Perfect: you can use a MultiPoint and specify two points (diagonal) or four points (the four corners of the "rectangle"—I'm using quotes because there are no rectangles on a sphere).