Select to view content in your preferred language

Near Me Widget - Possible to Automatically Toggle Layer Visibility?

394
4
07-04-2024 12:59 PM
Vinzafy
Frequent Contributor

Hey there,

I have a WebApp that utilizes the Situation Awareness Widget to list resources from 40+ layers on a map within the specified radius.

When re-creating that workflow in Experience Builder, based on this blog post, the proper widget to use is the Near Me widget. I've re-created some functionality using this , however a key function missing is layer visibility and toggling.

The 40+ layers in the map are turned off by default to prevent crowding the map and excessive load times. When the Situation Awareness widget is used in our original WebApp, any layers with features in the radius get turned on automatically when selected.

From the Situation Awareness widget documentation:

When the widget opens, visibility is turned off for all map layers that have been configured... The layers become visible when used by the widget

Is there a way to re-create this in Experience Builder out of the box or would that require creation of a custom widget via Developer Edition?

Based on threads I've looked at, it seems like toggling layer visibility may not be possible without using Developer Edition. There were some workarounds that came up (filter widget, switching between views), but nothing seemed to have the functionality of the original Situation Awareness widget.

I figured I'd ask here to see if anyone has solutions before getting in too deep.

Thanks all.

Vinzafy_0-1720122896730.png

Vinzafy_1-1720123105499.png

 

0 Kudos
4 Replies
HonghongLi
Esri Contributor

Hi, did you mean that you want the layer visibility to be controlled using the Near Me widget? Defining layer visibility by changing the URL parameter might be an alternative but any widget does not trigger it. This function allows you to turn on certain layers when you open the application, even if the webmap is still turned off. Check out here: https://doc.arcgis.com/en/experience-builder/latest/build-apps/url-parameters.htm#:~:text=Define%20v...

 

I don't think EB has any widget with the same functionality as the original Situation Awareness widget regarding its layer visibility property. 

 

Vinzafy
Frequent Contributor

Apologies for the delayed response! I had to take an extended break from this project. I appreciate the info regarding URL parameters and layer visibility. It is unfortunate that the Near Me widget doesn't include layer visibility as the original Situation Awareness widget does, but at least the core functionality still remains. Thanks again!

0 Kudos
JeffreyThompson2
MVP Regular Contributor

Toggling the layer visibility will require a custom widget.

But, Near Me can still find things with their visibility turned off, if that is a solution.

GIS Developer
City of Arlington, Texas
Vinzafy
Frequent Contributor

Apologies for the delayed response! I had to take an extended break from this project. It is unfortunate that the Near Me widget doesn't include layer visibility as the original Situation Awareness widget does, but at least the core functionality still remains. Thanks again!

0 Kudos