Disable popup without disabling the highlight

253
1
02-05-2024 05:26 AM
BartoszStolc
New Contributor

I am using ArcGIS SDK for JS with React. I'm trying to dynamically (at different application's state) disable/enable the popup for a specific layer but leaving the highlight. When I disable the popup like `someFeatureLayer.popupEnabled = false` the highlight is lost as well. I have read about the solution like enabling the highlight manually FeatureLayerView | API Reference | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers and removing it manually  Solved: Javascript API 4.X Clear Highlights - Esri Community. But it seems like a chore in conjunction with `useEffect` and I would presume, for such simple functionality, that ArcGIS should handle it on its own without using already mentioned methods. Is there a simpler way? Is it possible to simply enable the highlight by disable the popup on a specific layer?

Tags (2)
0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

No there is no automatic way of doing this if you disable popup. You have to use the layer view's highlight method to highlight as you already pointed out.

0 Kudos