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

zoom.scaleBy, scaleTo and translateTo should support a reference point. #178

Closed
mbostock opened this issue Jul 22, 2019 · 1 comment · Fixed by #184
Closed

zoom.scaleBy, scaleTo and translateTo should support a reference point. #178

mbostock opened this issue Jul 22, 2019 · 1 comment · Fixed by #184

Comments

@mbostock
Copy link
Member

Currently these functions all use the viewport centroid as the reference point, but it would be nice to be able to specify the point explicitly.

@mbostock
Copy link
Member Author

For example, in Zoomable Map Tiles, it would be great if double-clicking zoomed to the nearest power of two. But doing this requires overriding the dblclick.zoom listener to replace the default behavior, and it’s difficult to implement the desired behavior on top of zoom.scaleTo because that only zooms around the viewport’s centroid rather than the mouse location.

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

Successfully merging a pull request may close this issue.

1 participant