@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.3 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{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{getOrCreateMapValue as o}from"../../../../core/MapUtils.js";import s from"../../../../core/ReactiveMap.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";let i=class extends t{constructor(){super(...arguments),this._idToCounters=new s}get size(){return this._idToCounters.size}get objectIds(){return this._idToCounters.keys()}get highlightNamesByObjectId(){return n(this._idToCounters)}add(e,t){let s=!1;for(const r of e){const e=o(this._idToCounters,r,(()=>(s=!0,new Map))),i=e.get(t)??0;i||(s=!0),e.set(t,i+1)}return s}delete(e,t){let o=!1;for(const s of e){const e=this._idToCounters.get(s);if(!e)continue;let r=e.get(t);null!=r&&(r--,r>0?e.set(t,r):(e.delete(t),o=!0),0===e.size&&(this._idToCounters.delete(s),o=!0))}return o}};function*n(e){for(const[t,o]of e)yield[t,o.keys()]}i=e([r("esri.views.2d.layers.support.HighlightCounter")],i);export{i as HighlightCounter};