You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
1.9 KiB
7 lines
1.9 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("../../chunks/tslib.es6 ../../Viewpoint ../../core/Error ../../core/Evented ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../support/GoTo".split(" "),function(c,e,f,b,d,k,l,m,g,h){b=class extends h.GoToMixin(b.EventedAccessor){constructor(a){super(a);this._goingHomeController=this._initialViewpoint=null;this.go=this.go.bind(this)}destroy(){this._cancelGo();this.view=null}get state(){return this.view?.ready? |
|
this._goingHomeController?"going-home":"ready":"disabled"}set view(a){this._initialViewpoint=null;this._set("view",a);a&&a.when().then(()=>{this.view===a&&(this._initialViewpoint=a.viewpoint.clone(),this.notifyChange("viewpoint"))})}get viewpoint(){return this._get("viewpoint")||this._initialViewpoint}set viewpoint(a){this._set("viewpoint",a)}async go(){if(!this.view?.ready)throw new f("home:disabled-state","Cannot go when disabled.");this._cancelGo();this.emit("go");const a=new AbortController;this._goingHomeController= |
|
a;try{await this.view?.when(),await this.callGoTo({target:this.viewpoint,options:{signal:a.signal}})}catch(n){}this._goingHomeController=null}cancelGo(){this._cancelGo()}_cancelGo(){const {_goingHomeController:a}=this;a&&a.abort();this._goingHomeController=null}};c.__decorate([d.property()],b.prototype,"_goingHomeController",void 0);c.__decorate([d.property({readOnly:!0})],b.prototype,"state",null);c.__decorate([d.property()],b.prototype,"view",null);c.__decorate([d.property({type:e})],b.prototype, |
|
"viewpoint",null);c.__decorate([d.property()],b.prototype,"go",null);c.__decorate([d.property()],b.prototype,"cancelGo",null);return b=c.__decorate([g.subclass("esri.widgets.Home.HomeViewModel")],b)}); |