You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, I really love this package, so thanks for your awesome work! It's been particularly useful for implementing SVG maps.
Two functions I've needed have been something like:
centerOn({ x, y }) pans to center the map on a certain point. Basically the same thing as the existing pan function but centering that point in the viewport, instead of locating it at the top left.
zoomToEl(el) zoom to fit and center an element in the viewport, via its bounding box
I've been able to implement this on my own perfectly fine. But it'd, of course, be more elegant as part of the API on a panzoom instance.
I was wondering, if these functions are relevant for others, if it makes sense to add to the API? I'd be potentially able to help with that.
Thanks so much!
The text was updated successfully, but these errors were encountered:
ajdubovoy
changed the title
Add functions for centering and zooming on elements
Feature Request: Add functions for centering and zooming on elements
Jan 12, 2022
Hi folks, I really love this package, so thanks for your awesome work! It's been particularly useful for implementing SVG maps.
Two functions I've needed have been something like:
centerOn({ x, y })
pans to center the map on a certain point. Basically the same thing as the existingpan
function but centering that point in the viewport, instead of locating it at the top left.zoomToEl(el)
zoom to fit and center an element in the viewport, via its bounding boxI've been able to implement this on my own perfectly fine. But it'd, of course, be more elegant as part of the API on a panzoom instance.
I was wondering, if these functions are relevant for others, if it makes sense to add to the API? I'd be potentially able to help with that.
Thanks so much!
The text was updated successfully, but these errors were encountered: