Select to view content in your preferred language

Simple app workflow - zoom to selected polygon, switch layer visibility and show popup of point layer

274
4
a month ago
Labels (1)
BlairPellegrino
Occasional Contributor

I'm wanting to create a really simple app with the following functionality:

  • A map widget with two layers - a zones layer (polygon) and a monitoring sites layer (points).
  • When you first access the app, I want it to show only show the zones layer.
  • I then want to be able to click on a single polygon in the zones layer, for it to zoom to the extent of the polygon, for the zones layer to turn off and the monitoring sites layer to turn on.
  • I then want to be able to click on a monitoring site point and see attribute information.
  • Then when you zoom back out, the zones layer turns back on and the monitoring sites layer turns off.

This sounds simple enough but have run into the following limitations:

  • I don't seem to be able to create an action triggered by selecting a feature if I only have one widget (the map widget).  To get around this, I've followed the suggestion in this post to create a second map widget in the background and create a series of actions which zoom the background map based on a selection in the main map, the change the extent in the main map based on an extent change in the background map.  Clunky but it works!
  • I have applied visibility ranges to both of my layers in the map viewer, but this conflicts with the action to zoom to the feature.  It won't seem to zoom to the selected zone if it results in a scale that is beyond the visibility range.
  • I attempted to remove the visibility range on the zones layer and leave this as an outline, but when I try to select the monitoring sites point, it also selects the zones layer.
  • Another issue I'm experiencing is I actually don't want the popup to appear on the zones layer.  But when I disable it in the map viewer, it doesn't allow a selection.  If I instead disable popups via ExpB (as suggested in this post), it disables popups for both layers, which I don't want either.

Any ideas an suggestions welcome! 

*I'm using ArcGIS Online

0 Kudos
4 Replies
VenkataKondepati
Occasional Contributor

Hi @BlairPellegrino,

Yes, you can configure that workflow using the Select and Map widgets in Experience Builder.

Steps to set it up:

Add a Select widget and configure it to target your polygon layer.

In the Select widget’s settings, enable a data action to your Map widget: choose “Zoom to”.

Also configure the Map widget so that when the polygon is selected, the popup of your point layer is shown or a filter is applied to highlight related points.

To toggle visibility, add another data action “Change layer visibility” triggered by the same Select widget.

This lets an end user click a polygon, zoom into it, switch other layers on/off, and view the point popup—all in one seamless workflow.

Let me know if you’d like a specific example configuration or screenshot of the widget actions.

Regards,
Venkat

0 Kudos
BlairPellegrino
Occasional Contributor

Hi @VenkataKondepati - thanks so much for the detailed description.  So you're thinking the only way is through adding the Select widget?  We were really hoping of achieving a workflow that's as simple and intuitive as possible and with minimal mouse-clicks, but I'll put it to the team as an option!

Ke_Xu
by Esri Regular Contributor
Esri Regular Contributor

Hi @BlairPellegrino,

Please try to use layer visibility and message action.

1. In Map View, set the layer visiblity for the polygon layer and point layer. For example, for a polygon layer, set its maximum scale to 800. For a point layer, set its minimum scale to 800.

2. In Experience Builder,drag a Table widget and add polygon layer to it. Then configure it with message action.

1)Record selection changes - > Map -> Zoom to, then set the Zoom scale to Custom. (This should also be set to 800, but I had some minor problems during testing, so I set it to 600.) 

2) Record selection changes -> Framework -> Filter data records, select the polygon layer as Trigger and Action data.

3. Turn on Live view, select a record in the Table widget and see the result.

 

Thanks,

Ke

 

 

 

0 Kudos
BlairPellegrino
Occasional Contributor

Thanks for the response @Ke_Xu - similar to my response above, that requires additional widgets and mouse-clicks which we're desperately trying to avoid.  Unfortunately it doesn't seem possible to achieve the simple and seamless user experience we were hoping! 

Also I think I experienced the same issues you did with regard to the zooming - if you have the a visibility scale set on a layer and try to use it in a 'zoom to' action, it won't work if that would result in it zooming to a scale beyond the visibility scale, and instead seems to default to zooming in as close as it can without the visibility scale kicking in.  I can maybe see the logic here, but not I'm wanting in this instance.

0 Kudos