Custom Gis Application with Arcgis Javascript API with modern layouting
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.
 
 

12 lines
4.6 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 ../../core/Accessor ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../layers/video/videoUtils".split(" "),function(c,b,f,d,n,p,q,l,e){function h(a,g){const k={};for(const m of g)if(g=a.get(m))k[g.name]=g.value;return k}b=class extends b{constructor(a){super(a);this.followingMode="follow-both";this.layer=null;this.seekLength=10;this.view=null}initialize(){this.addHandles([f.watch(()=>
this.layer,a=>{a&&a.load().then(()=>this._followTelemetry()).catch(()=>{})},f.initial),f.watch(()=>[this.followingMode],()=>this._followTelemetry(),f.initial)])}get _layerView(){return this.layer&&this.view?this.view.allLayerViews.find(a=>a.layer===this.layer)??null:null}get buffered(){return this.layer?.buffered||0}get currentTime(){return this.layer?.currentTime||0}get duration(){return this.layer?.duration||0}get ended(){return this.layer?.ended??!0}get metadata(){const a=this.layer?.metadata;
return a?{missionInfo:h(a,[e.videoMetadataEntryId.MissionId,e.videoMetadataEntryId.PrecisionTimeStamp]),platformInfo:h(a,[e.videoMetadataEntryId.PlatformTailNumber,e.videoMetadataEntryId.PlatformTrueAirspeed,e.videoMetadataEntryId.PlatformCallSign,e.videoMetadataEntryId.PlatformDesignation,e.videoMetadataEntryId.PlatformGroundRange]),frameInfo:h(a,[e.videoMetadataEntryId.FrameCenterElevation,e.videoMetadataEntryId.FrameCenterLatitude,e.videoMetadataEntryId.FrameCenterLongitude])}:null}get playing(){return this.layer?.playing??
!1}get state(){return this.layer?.loadError?"error":this.layer?.state}play(){this.layer?.play()}pause(){this.layer?.pause()}seekBackward(){if(this.layer){const a=this.layer.currentTime-this.seekLength;0>=a?this.layer.reset():this.layer.setCurrentTime(a)}}seekForward(){if(this.layer){const a=this.layer.currentTime+this.seekLength;a>=this.layer.duration?this.layer.reset():this.layer.setCurrentTime(a)}}seekToBeginning(){this.layer?.setCurrentTime(0)}seekToEnding(){this.layer?.setCurrentTime(this.layer.duration)}seekTo(a){this.layer?.setCurrentTime(a)}toggleSensorDisplay(){this._layerView?.visibleTelemetryElements&&
(this._layerView.visibleTelemetryElements.sensorLocation=!this._layerView.visibleTelemetryElements.sensorLocation)}toggleSensorSightLineDisplay(){this._layerView?.visibleTelemetryElements&&(this._layerView.visibleTelemetryElements.lineOfSight=!this._layerView.visibleTelemetryElements.lineOfSight)}toggleSensorTrailDisplay(){this._layerView?.visibleTelemetryElements&&(this._layerView.visibleTelemetryElements.sensorTrail=!this._layerView.visibleTelemetryElements.sensorTrail)}toggleFrameCenterDisplay(){this._layerView?.visibleTelemetryElements&&
(this._layerView.visibleTelemetryElements.frameCenter=!this._layerView.visibleTelemetryElements.frameCenter)}toggleFrameOutlineDisplay(){this._layerView?.visibleTelemetryElements&&(this._layerView.visibleTelemetryElements.frameOutline=!this._layerView.visibleTelemetryElements.frameOutline)}changePlaybackSpeed(a){this.layer&&(this.layer.playbackRate=a)}changeGraphicsColor(a){this._layerView&&(this._layerView.symbolColor=a)}_followTelemetry(){this.removeHandles("follow");this.view&&this.layer&&this.addHandles(f.watch(()=>
this.layer?.telemetry,()=>{const a=[],g="follow-frame"===this.followingMode||"follow-both"===this.followingMode;"follow-sensor"!==this.followingMode&&"follow-both"!==this.followingMode||!this.layer?.telemetry.sensorLocation||a.push(this.layer.telemetry.sensorLocation);g&&this.layer?.telemetry.frameCenter&&a.push(this.layer.telemetry.frameCenter);a.length&&this.view?.goTo(a).catch(()=>{})},f.initial),"follow")}};c.__decorate([d.property()],b.prototype,"_layerView",null);c.__decorate([d.property({readOnly:!0})],
b.prototype,"buffered",null);c.__decorate([d.property({readOnly:!0})],b.prototype,"currentTime",null);c.__decorate([d.property({readOnly:!0})],b.prototype,"duration",null);c.__decorate([d.property({readOnly:!0})],b.prototype,"ended",null);c.__decorate([d.property()],b.prototype,"followingMode",void 0);c.__decorate([d.property()],b.prototype,"layer",void 0);c.__decorate([d.property({readOnly:!0})],b.prototype,"metadata",null);c.__decorate([d.property({readOnly:!0})],b.prototype,"playing",null);c.__decorate([d.property()],
b.prototype,"seekLength",void 0);c.__decorate([d.property({readOnly:!0})],b.prototype,"state",null);c.__decorate([d.property()],b.prototype,"view",void 0);return b=c.__decorate([l.subclass("esri.widgets.VideoPlayer.VideoPlayerViewModel")],b)});