@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.28 kB
JavaScript
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as i,c as p}from"../../../../chunks/vec2.js";import{a as n}from"../../../../chunks/vec2f64.js";import{getAnchor as c,rotateBy as a,angleBetween as m}from"../../viewpointUtils.js";import v from"../../../../geometry/Point.js";const u=n(),d=n();let j=class extends o{constructor(t){super(t),this._previousCenter=n(),this.viewpoint=new e({targetGeometry:new v,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),i(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:o,padding:r}}=t;i(u,e.center.x,e.center.y),c(d,o,r),t.viewpoint=a(this.viewpoint,t.state.paddedViewState.viewpoint,m(d,this._previousCenter,u)),p(this._previousCenter,u)}end(){this.navigation.end()}};t([r()],j.prototype,"viewpoint",void 0),t([r()],j.prototype,"navigation",void 0),j=t([s("esri.views.2d.actions.Rotate")],j);const f=j;export{f as default};