-
Notifications
You must be signed in to change notification settings - Fork 292
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
Option to enabled/disable pan zoom #11
Comments
i agree 100%. |
I was wondering the same. It would be really nice to disable/enable these things manually. I added some functions to make it possible in my code. function disable() {
wheel.removeWheelListener(owner, onMouseWheel)
owner.removeEventListener('mousedown', onMouseDown)
owner.removeEventListener('keydown', onKeyDown)
owner.removeEventListener('dblclick', onDoubleClick)
if (frameAnimation) {
window.cancelAnimationFrame(frameAnimation)
frameAnimation = 0
}
}
function enable() {
owner.addEventListener('mousedown', onMouseDown)
owner.addEventListener('dblclick', onDoubleClick)
owner.addEventListener('touchstart', onTouch)
owner.addEventListener('keydown', onKeyDown)
wheel.addWheelListener(owner, onMouseWheel)
} return {
enable: enable,
disable: disable,
dispose: dispose,
moveBy: internalMoveBy,
moveTo: moveTo,
centerOn: centerOn,
zoomTo: publicZoomTo,
zoomAbs: zoomAbs,
getTransform: getTransformModel,
showRectangle: showRectangle
} It might not be the optimal solution though. |
Is there any plan to implement this functionality ? |
this would be great for a project of mine? Any developments? |
Just found it, https://www.npmjs.com/package/jquery.panzoom#disable Thanks alot! |
HI guys, just added three methods |
This library has made my job easier. I would like to see option or function to enable/disable pan and or zoom.
Right now the only way to achieve is to
dispose()
and recreate;The text was updated successfully, but these errors were encountered: