ZoomAndPan
Source: zoomPan.js:37
ZoomAndPan class. A tap sets the current position and fires a tap event with the annotations and segments under it (see PositionSetTapBehavior).
Example
CODE
import {App, AppOptions, ViewConfig, ToolConfig} from '//esm.sh/dwv';
// create the dwv app
const app = new App();
// initialise
const viewConfig0 = new ViewConfig('layerGroup0');
const viewConfigs = {'*': [viewConfig0]};
const options = new AppOptions(viewConfigs);
options.tools = {ZoomAndPan: new ToolConfig()};
app.init(options);
// activate tool
app.addEventListener('load', function () {
app.setTool('ZoomAndPan');
});
// load dicom data
app.loadURLs([
'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
]);Constructor
new ZoomAndPan(app: App): ZoomAndPanParameters
app(App) — The associated application.
Instance Methods
activate(bool: boolean)
Activate the tool.
Parameters
bool(boolean) — The flag to activate or not.
init()
Initialise the tool.
setFeatures(_features: object)
Set the tool live features: does nothing.
Parameters
_features(object) — The list of features.
getEventNames(): Array.<string>
Get the list of event names that this tool can fire.
Returns
Array.<string>— The list of event names.
Instance Fields
keydown
Handle key down event.
Parameters
event(object) — The key down event.