@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 977 B
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{FeatureMatcher as t}from"./Matcher.js";class e extends t{static async fromDictionaryRenderer(t,s){return new e(t,s)}constructor(t,e){super(),this._context=t,this._schema=e,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(t,e){const s=e.getCursor(),r=[];for(;s.next();)r.push(this._updateMeshWriterGroup(t,s));await Promise.all(r)}match(t,e){const s=t.getAttributeHash();return this._hashToGroup.get(s)}async _updateMeshWriterGroup(t,e){const s=e.readLegacyFeatureForDisplay(),r=e.getAttributeHash();if(this._hashToGroup.has(r))return;this._hashToGroup.set(r,null);const a=await t.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:s});if(!a)return;const h=await this._context.createMeshWriters(a.meshes);this._hashToGroup.set(r,h)}}export{e as DictionaryMatcher};