UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 2.87 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Evented.js";import{destroyHandle as o}from"../../../../core/handleUtils.js";import{watch as r,on as i,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{MediaElementControllerControlPoints as a}from"./media/MediaElementControllerControlPoints.js";import{MediaElementControllerShape as p}from"./media/MediaElementControllerShape.js";import{MediaElementManipulator3D as m}from"./media/MediaElementManipulator3D.js";import{isMediaElementVisibleLayerView as c}from"./media/mediaElementUtils.js";const d=Symbol();let u=class extends t.EventedAccessor{get operations(){return this._controller?.operations}get elevationInfo(){return{mode:"on-the-ground",offset:0}}get _layerView(){const e=this.view.allLayerViews.find((e=>e.layer===this.layer));return"media-3d"===e?.type?e:null}get visible(){return c(this._layerView,this.element)}get isDraped(){return!0}get origin(){return null}get updating(){return!!this._controller?.updating}get _controllerClass(){return"transform"===this.tool||"control-points"!==this.element.georeference?.type?p:a}constructor(e){super(e),this.tool="transform"}initialize(){this.addHandles([r((()=>this._controllerClass),(e=>this._updateController(e)),l),i((()=>this._layerView),"element-render-changed",(({element:e})=>{this.element===e&&this.emit("committed")}))])}toMap(e){const{layer:t,element:o}=this;return this.view.toMap(e,{include:{layer:t,element:o}})}createManipulator(e){const{view:t,layer:o,element:r}=this;return new m({view:t,layer:o,element:r,...e})}_updateController(e){if(this._controller&&this._controller instanceof e)return;this.removeHandles(d);const{view:t,layer:r,element:i}=this,l=()=>{this.emit("modified-externally")};this._controller=new e({view:t,layer:r,element:i,onModifiedExternally:l}),l(),this.addHandles(o(this._controller),d)}};e([n({constructOnly:!0})],u.prototype,"view",void 0),e([n({constructOnly:!0})],u.prototype,"layer",void 0),e([n({constructOnly:!0})],u.prototype,"element",void 0),e([n()],u.prototype,"tool",void 0),e([n()],u.prototype,"_controller",void 0),e([n()],u.prototype,"elevationInfo",null),e([n()],u.prototype,"_layerView",null),e([n()],u.prototype,"visible",null),e([n()],u.prototype,"updating",null),e([n()],u.prototype,"_controllerClass",null),u=e([s("esri.views.3d.interactive.editingTools.ManipulatedObject3DMediaElement")],u);export{u as ManipulatedObject3DMediaElement};