I used WAB for ArcGIS (not the Developer version) to configure one of my first apps. The Near Me widget is not behaving the way I would expect it to.
When using the widget, it returns any features within the searchable layers but draws almost ALL the layers, regardless of whether any results were returned. Once the widget is closed, all these layers stay on. The only layers that are not turned on are where the group layer was turned off by default. I have attached screen images of before and after using Near Me.
Ideally, only the layers that return a search result should be visible while the widget is in use...and I would prefer it if the layers would return to the state that they were in prior to using Near Me. All the layers are published in a single map service. I have read about other workarounds (including duplicating 'invisible' layers for Near Me) but these are not desirable.
This question may be related to these posts, but haven't solved my problem:
Any advice appreciated.
Unfortunately still not resolved. This issue is preventing us from progressing our plan to deploy a public map on our website for community engagement purposes and enquiries.
Hi there Sandra! Sorry for the late reply. After being on the phone for some time with tech support, there was no real solution to the issue except to create a brand new web map and app.. It solved my issue with the superfluous layers turning on but its worrisome that the only solution is to basically recreate an entire project. After recreating my web map and app, I haven't had the same issue again though.
Latest update - I have discovered the cause of my issue. The map service, which is hosted on ArcGIS server, has many layers which have been grouped into categories e.g. Boundaries, Assets, Topographic etc. I had set some of these group layers on by default because some of the sub-layers need to be on by default. The issue of ALL sub-layers being turned ON after using the Near Me widget occurs when those sub-layers are under a group layer that is also ON by default (even if those sub-layers are not configured as a search layer). Sub-layers that are under a group layer that is OFF by default remain OFF after using Near Me.
I re-organised my map in ArcMap so that any layer that needs to be ON by default sits under a group layer that is also on. All other layers that I want to remain OFF by default sit under group layers that are also OFF. This is the only way I can get the Near Me widget to work the way I want it to (layers to remain OFF after using it).
However, a separate issue has also been found which Esri has been able to replicate and will be reported as a bug. This issue is that the layer state is inconsistent after using the Near Me widget under certain circumstances.