1 |
- import{cJ as s,ct as p,_ as h,$ as a,a0 as o}from"./index.a33cbbbf.js";import{y as g,u as m}from"./LayerView.a376b311.js";import{i as l}from"./GraphicContainer.5750859b.js";import{o as c}from"./BaseGraphicContainer.61ec98f8.js";import"./utils.4103b17b.js";import"./Utils.2784465f.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.bb8fc8d4.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.3d30b027.js";import"./ExpandedCIM.a8fa01db.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.cc6dbee4.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.c691d660.js";import"./normalizeUtilsSync.a27dc574.js";import"./projectionSupport.3c0a8e6b.js";import"./json.879c9adc.js";import"./VertexArrayObject.11764b17.js";import"./FeatureContainer.17691685.js";import"./TileContainer.b979996b.js";import"./WGLContainer.7ba4a5be.js";import"./pixelUtils.e4fffbea.js";import"./ProgramTemplate.01f7d661.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.d8750e37.js";import"./visualVariablesUtils.d684f3b8.js";import"./Matcher.a3df4c4c.js";import"./tileUtils.89d38bf9.js";import"./TileClipper.4aabb163.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.516cb963.js";import"./createSymbolSchema.2297e3ae.js";import"./util.d9684b28.js";import"./ComputedAttributeStorage.2608008c.js";import"./centroid.8b0eb79d.js";import"./vec3f32.1121a836.js";const n={remove(){},pause(){},resume(){}};let r=class extends g(m){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new c({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new l(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.handles.add(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),"graphicslayerview2d")}detach(){this.container.removeAllChildren(),this.graphicsView.destroy(),this.graphicsView=null,this.handles.remove("graphicslayerview2d")}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}async fetchPopupFeatures(i){if(this.graphicsView)return this.graphicsView.hitTest(i).filter(t=>!!t.popupTemplate)}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i){let t;return typeof i=="number"?t=[i]:i instanceof s?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):p.isCollection(i)&&i.length>0&&(t=i.map(e=>e&&e.uid).toArray()),t=t==null?void 0:t.filter(e=>e!=null),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):n}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){var i;(i=this.graphicsView)==null||i.setHighlight(Array.from(this._highlightIds.keys()))}};h([a()],r.prototype,"graphicsView",void 0),r=h([o("esri.views.2d.layers.GraphicsLayerView2D")],r);const ri=r;export{ri as default};
|