The pinch handler is used to deal with sequences of browser events related to pinch gestures. The handler is used by controls that want to know when a pinch sequence begins, when a pinch is happening, and when it has finished.
Controls that use the pinch handler typically construct it with callbacks for ‘start’, ‘move’, and ‘done’. Callbacks for these keys are called when the pinch begins, with each change, and when the pinch is done.
Create a new pinch handler with the OpenLayers.Handler.Pinch constructor.
OpenLayers. | The pinch handler is used to deal with sequences of browser events related to pinch gestures. |
Properties | |
started | {Boolean} When a touchstart event is received, we want to record it, but not set ‘pinching’ until the touchmove get started after starting. |
stopDown | {Boolean} Stop propagation of touchstart events from getting to listeners on the same element. |
pinching | {Boolean} |
last | {Object} Object that store informations related to pinch last touch. |
start | {Object} Object that store informations related to pinch touchstart. |
Constructor | |
OpenLayers. | Returns OpenLayers.Handler.Pinch |
Functions | |
touchstart | Handle touchstart events |
touchmove | Handle touchmove events |
touchend | Handle touchend events |
activate | Activate the handler. |
deactivate | Deactivate the handler. |
getDistance | Get the distance in pixels between two touches. |
getPinchData | Get informations about the pinch event. |
Returns OpenLayers.Handler.Pinch
control | {OpenLayers.Control} The control that is making use of this handler. If a handler is being used without a control, the handlers setMap method must be overridden to deal properly with the map. |
callbacks | {Object} An object containing functions to be called when the pinch operation start, change, or is finished. The callbacks should expect to receive an object argument, which contains information about scale, distance, and position of touch points. |
options | {Object} |
Handle touchstart events
touchstart: function( evt )
Handle touchmove events
touchmove: function( evt )
Handle touchend events
touchend: function( evt )
Activate the handler.
activate: function()
Deactivate the handler.
deactivate: function()
Get the distance in pixels between two touches.
getDistance: function( touches )
Get informations about the pinch event.
getPinchData: function( evt )