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.
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!