Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Layer with perspective #3945

Closed
grahambates-sp opened this issue Nov 29, 2019 · 2 comments
Closed

SVG Layer with perspective #3945

grahambates-sp opened this issue Nov 29, 2019 · 2 comments
Labels

Comments

@grahambates-sp
Copy link

I am trying to get a SVG layer moving in sync with a deckgl layer when the map is tilted/pitched.

From the following link you can see the 2 layers

https://codesandbox.io/s/d3-volonoi-overlay-y2ubs

If you navigate to line 47 in svg-overlay.js and put the style attribute back in, you will witness the perspective is fixed but now each element has lost its position on the map (bizarely, this also happens on the deckgl layer).

Has anyone else encountered this and found a solution?

@grahambates-sp
Copy link
Author

If anyone else encounters this, I worked out how to do it.

In Chrome at least, it is possible to do the following. I dont think all browsers support these transforms in svg however.

.styles(d => ({
        "transform-origin": `0px  ${d[1]}px`,
        transform: `rotate3d(1, 0, 0, ${viewport.pitch}deg)`
      }));

(You will need to import d3-selection-multi for this to work. See here.

https://codesandbox.io/s/d3-volonoi-overlay-rnjhh

@tgorkin
Copy link
Contributor

tgorkin commented Dec 10, 2019

Thanks for following up with a solution!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants