@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 8.34 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as r}from"../core/lang.js";import{setDeepValue as i}from"../core/object.js";import{property as o,subclass as a}from"../core/accessorSupport/decorators.js";import n from"../geometry/SpatialReference.js";import p from"../graphic/OrientedImageryGraphicOrigin.js";import s from"./FeatureLayer.js";import{useViewTimeProperty as l}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as d,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as y,verticalMeasurementTypeMap as u,isOrientationAccuracy as c,padAccuracyArray as h}from"./orientedImagery/core/utils.js";import f from"./support/Field.js";import g from"../tables/AttributeTableTemplate.js";import v from"../time/TimeExtent.js";import{writer as S}from"../core/accessorSupport/decorators/writer.js";const j=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),P=new Set(["elevationSource"]),I=(e,t)=>!j.has(t)&&e,w=(e,t,r)=>{const i=`orientedImageryProperties.${e}`,o={allowNull:P.has(e),ignoreOrigin:!0};return{name:i,write:t?{...o,target:i,writer:t}:o,read:r?{ignoreOrigin:!0,source:i,reader:r}:{ignoreOrigin:!0}}};function O(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function x(e,t,r,i){const{name:o,write:a,read:n}=w(e,t,r),p={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:r},"web-scene":{name:o,write:I(a,e),read:I(n,e)},"web-map":{name:o,write:a,read:n}}};return i&&p.origins?(p.type=i,p.origins["web-map"].type=i,p.origins["web-scene"].type=i,p):p}let b=class extends s{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new p(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.verticalSearchRange=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.dataStoreID=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:r}=this;return d(e,t,r)}get effectiveSequenceOrderField(){const{sequenceOrderField:e,fields:t}=this;return t.find(t=>t.name.toLowerCase()===e?.toLowerCase())?.name??"SequenceOrder"}set fieldConfigurations(e){}get fieldConfigurations(){}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON(i))}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:g,json:{write:!1,read:!1}})],b.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:x("cameraHeading")})],b.prototype,"cameraHeading",void 0),e([o({type:Number,json:x("cameraHeight")})],b.prototype,"cameraHeight",void 0),e([o({type:Number,json:x("cameraPitch")})],b.prototype,"cameraPitch",void 0),e([o({type:Number,json:x("cameraRoll")})],b.prototype,"cameraRoll",void 0),e([o({type:Number,json:x("coveragePercent")})],b.prototype,"coveragePercent",void 0),e([o({type:String,json:x("demPathPrefix")})],b.prototype,"demPathPrefix",void 0),e([o({type:String,json:x("demPathSuffix")})],b.prototype,"demPathSuffix",void 0),e([o({type:String,json:x("depthImagePathPrefix")})],b.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:x("depthImagePathSuffix")})],b.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:x("elevationSource")})],b.prototype,"elevationSource",void 0),e([o({readOnly:!0})],b.prototype,"effectiveElevationSource",null),e([o({readOnly:!0})],b.prototype,"effectiveSequenceOrderField",null),e([o({type:Number,json:x("farDistance")})],b.prototype,"farDistance",void 0),e([o({json:{write:!1}})],b.prototype,"fieldConfigurations",null),e([o({type:[f]})],b.prototype,"fields",void 0),e([o()],b.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],b.prototype,"graphicOrigin",void 0),e([o({type:Number,json:x("horizontalFieldOfView")})],b.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:x("horizontalMeasurementUnit")})],b.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...x("imageGeometryField"),default:"ImageGeometry"}})],b.prototype,"imageGeometryField",void 0),e([o({type:String,json:x("imagePathPrefix")})],b.prototype,"imagePathPrefix",void 0),e([o({type:String,json:x("imagePathSuffix")})],b.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...x("imageReferenceField"),default:"OIObjectID"}})],b.prototype,"imageReferenceField",void 0),e([o({type:Number,json:x("imageRotation")})],b.prototype,"imageRotation",void 0),e([o({type:Number,json:x("maximumDistance")})],b.prototype,"maximumDistance",void 0),e([o({type:Number,json:x("nearDistance")})],b.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],b.prototype,"operationalLayerType",void 0),e([o({json:{...x("orientationAccuracy",(e,t,r)=>{i(r,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return c(t)?h(t):[0,0,0,0,0,0,0,0]},String)}})],b.prototype,"orientationAccuracy",void 0),e([o({json:{...x("orientedImageryType",m.write,m.read,m.jsonValues.slice(1))}})],b.prototype,"orientedImageryType",void 0),e([S("popupTemplate")],b.prototype,"writePopupTemplate",null),e([o({type:String,json:{...x("referenceIDField"),default:"OBJECTID"}})],b.prototype,"referenceIDField",void 0),e([o({type:String,json:{...x("sequenceOrderField"),default:"SequenceOrder"}})],b.prototype,"sequenceOrderField",void 0),e([o({type:n})],b.prototype,"spatialReference",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],b.prototype,"type",void 0),e([o({type:y.apiValues,json:{...x("timeIntervalUnit",y.write,y.read,y.jsonValues)}})],b.prototype,"timeIntervalUnit",void 0),e([o(O(r(l)))],b.prototype,"useViewTime",void 0),e([o({type:Number,json:x("verticalFieldOfView")})],b.prototype,"verticalFieldOfView",void 0),e([o({type:u.apiValues,json:{...x("verticalMeasurementUnit",u.write,u.read,u.jsonValues)}})],b.prototype,"verticalMeasurementUnit",void 0),e([o({type:Number,json:x("verticalSearchRange")})],b.prototype,"verticalSearchRange",void 0),e([o({type:String,json:x("videoPathPrefix")})],b.prototype,"videoPathPrefix",void 0),e([o({type:String,json:x("videoPathSuffix")})],b.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],b.prototype,"virtualCacheDirectory",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.dsid",read:!0}}}})],b.prototype,"dataStoreID",void 0),e([o({type:v,json:{origins:{"web-scene":{write:!1,read:!1}}}})],b.prototype,"visibilityTimeExtent",void 0),b=e([a("esri.layers.OrientedImageryLayer")],b);const T=b;export{T as default};