@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.72 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import e from"../../../../../../geometry/SpatialReference.js";import{getJsonType as t}from"../../../../../../geometry/support/jsonUtils.js";import r from"../../../../../../layers/support/FieldsIndex.js";import{MeshData as o}from"../../mesh/MeshData.js";import{createMeshWriter as s}from"./createMeshWriter.js";import{AResourceProxy as n}from"./mesh/AResourceProxy.js";import{ComputedAttributeStorage as a}from"../../../../layers/features/support/ComputedAttributeStorage.js";import{FeatureMetadata as m}from"../../../../layers/features/support/FeatureMetadata.js";import{FeatureSetReaderJSON as i}from"../../../../layers/features/support/FeatureSetReaderJSON.js";async function u(n){const u=new o("0.0.0.0"),d=new p,l={},c={fields:new r,spatialReference:e.WebMercator},f={$view:{scale:0,timeZone:null,timeProperties:{currentStart:null,currentEnd:null}}},h=new a(c);for(const e of n){const r=await s(h,d,l,e.instanceId,e.meshParams,e.meshWriterClass);e.feature.displayId=e.feature.attributes.objectId;const o=i.fromFeatures([e.feature],m.minimal(t(e.feature.geometry),"objectId",[]));o.next(),u.entityStart(o.getDisplayId(),0),r.write(u,d,o,f,0),u.entityEnd()}return u.serialize().message}class p extends n{fetchDictionaryResourceImmediate(e){throw new Error("Method not implemented.")}fetchResourceImmediate(e){throw new Error("Method not implemented.")}enqueueRequest(e){throw new Error("Method not implemented.")}fetchEnqueuedResources(){throw new Error("Method not implemented.")}getResource(e){throw new Error("Method not implemented.")}}export{u as createTestMeshData};