UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 763 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{FeatureSetReaderJSON as e}from"../support/FeatureSetReaderJSON.js";class t{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return e.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate(e?.length??0)}}export{t as StreamFeatureStore};