@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 842 B
JavaScript
import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{ZoomStepController as t}from"../../state/controllers/global/ZoomStepController.js";import{ZoomStepController as e}from"../../state/controllers/local/ZoomStepController.js";import{InputHandler as r}from"../../../input/InputHandler.js";import{eventMatchesPointerAction as i}from"../../../input/handlers/support.js";class s extends r{constructor(o,t){super(!0),this._view=o,this.registerIncoming("double-click",t,(o=>this._handleDoubleClick(o)))}_handleDoubleClick(r){const s=r.data;if(i(s,"primary")){const i=this._view.state.isGlobal?new t({view:this._view,mode:"animation"}):new e({view:this._view,mode:"animation"});this._view.state.switchCameraController(i),i.zoomStep(Math.log(.5)/Math.log(.6),o(s.x,s.y)),r.stopPropagation()}}}export{s as DoubleClickZoom};