UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.01 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{numericHash as e}from"../../../../../../core/string.js";import{validateLabelingInfo as s}from"../../../../../../layers/support/labelingInfo.js";import{getServiceGeometryType as l}from"../../layerAdapters/geometryUtils.js";import{createSymbolMeshSchemas as o}from"./symbols/SymbolSchema.js";async function a(e,o,a){const r=o.labelsVisible&&o.labelingInfo||[],i=l(o),t=s(r,i);return{type:"label",classes:await Promise.all(t.map(((s,l)=>n(e,s,o.labelsVisible,o.labelingInfoSource,l,i,a))))}}async function n(s,l,a,n,r,i,t){const m=e(`${n} ${r}`),c=await o(l,{schemaOptions:s,uniforms:t,labelClassId:m});return{maxScale:l.maxScale,minScale:l.minScale,deconflictionEnabled:"none"!==l.deconflictionStrategy&&a,expression:l.labelExpressionInfo?.expression??l.labelExpression,where:l.where,meshes:c,labelClassId:m,geometryType:i}}export{a as createLabelMatcherSchema};