12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as o}from"../../chunks/tslib.es6.js";import"../../geometry.js";import e from"../../core/Accessor.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../layers/support/LOD.js";import{GeometryConstraint as i}from"./constraints/GeometryConstraint.js";import n from"./constraints/RotationConstraint.js";import a from"./constraints/ZoomConstraint.js";import m from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";const p={base:null,key:"type",typeMap:{extent:m,polygon:l}};let c=class extends e{constructor(o){super(o),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(o){o?this._set("geometry",o):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _defaultLODs(){const o=this.view?.defaultsFromMap?.tileInfo,e=this.view?.spatialReference;return o&&e&&o.spatialReference.equals(e)?o.lods:null}get _geometry(){return new i({geometry:this.geometry,spatialReference:this.view?.spatialReference})}get _rotation(){return new n({rotationEnabled:this.rotationEnabled})}get _zoom(){const o=this._get("_zoom"),e=this.lods||this._defaultLODs,t=this.minZoom,r=this.maxZoom,s=this.minScale,i=this.maxScale,n=this.snapToZoom;return o&&o.lods===e&&o.minZoom===t&&o.maxZoom===r&&o.minScale===s&&o.maxScale===i&&o.snapToZoom===n?o:new a({lods:e,minZoom:t,maxZoom:r,minScale:s,maxScale:i,snapToZoom:n})}canZoomInTo(o){const e=this.effectiveMaxScale;return 0===e||o>=e}canZoomOutTo(o){const e=this.effectiveMinScale;return 0===e||o<=e}constrain(o,e){return this._zoom.constrain(o,e),this._rotation.constrain(o,e),this._geometry.constrain(o,e),o}constrainByGeometry(o){return this._geometry.constrain(o)}fit(o){return this._zoom.fit(o)}zoomToScale(o){return this._zoom.zoomToScale(o)}scaleToZoom(o){return this._zoom.scaleToZoom(o)}snapScale(o){return this._zoom.snapToClosestScale(o)}snapToNextScale(o){return this._zoom.snapToNextScale(o)}snapToPreviousScale(o){return this._zoom.snapToPreviousScale(o)}};o([t({readOnly:!0})],c.prototype,"effectiveLODs",null),o([t({readOnly:!0})],c.prototype,"effectiveMinScale",null),o([t({readOnly:!0})],c.prototype,"effectiveMaxScale",null),o([t({readOnly:!0})],c.prototype,"effectiveMinZoom",null),o([t({readOnly:!0})],c.prototype,"effectiveMaxZoom",null),o([t({types:p,value:null})],c.prototype,"geometry",null),o([t({type:[s]})],c.prototype,"lods",void 0),o([t()],c.prototype,"minScale",void 0),o([t()],c.prototype,"maxScale",void 0),o([t()],c.prototype,"minZoom",void 0),o([t()],c.prototype,"maxZoom",void 0),o([t()],c.prototype,"rotationEnabled",void 0),o([t()],c.prototype,"snapToZoom",void 0),o([t()],c.prototype,"view",void 0),o([t({readOnly:!0})],c.prototype,"version",null),o([t()],c.prototype,"_defaultLODs",null),o([t({type:i})],c.prototype,"_geometry",null),o([t({type:n})],c.prototype,"_rotation",null),o([t({readOnly:!0,type:a})],c.prototype,"_zoom",null),c=o([r("esri.views.2d.MapViewConstraints")],c);const u=c;export{u as default};
|