need to add an action to zoom to selected on the map

3160
7
09-28-2022 05:26 PM
L77
by
Occasional Contributor

This is my first time using Experience Builder and I am stuck on this step:

On the map section I clicked:

Add a trigger 

Record Selection Changes

(and want to add an action of zoom to selected, but I can't figure it out)

Lorraine77_0-1664410871741.png

I click Add Action and select a target pops up on the left but I don't see an option for zoom to selected.

Lorraine77_1-1664411055049.png

 

 

0 Kudos
7 Replies
TonghuiMing
Esri Regular Contributor

Hi @L77, if you want to zoom to the selection, the map widget is not the trigger (but rather the action part). Thus, you should configure the trigger inside whichever widget you want to actually trigger the map zoom, such as a List widget (when you make the selection), instead of within the Map.

 

Here are more details of the message action and all related definitions for your reference:

https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/action-triggers.htm#ESRI_SECTI... 

0 Kudos
L77
by
Occasional Contributor

For my layout I have a map and a feature info widget:

I have it configured so when someone clicks on a point the data for the point shows up in the feature info box.

Lorraine77_1-1664461736898.png

 

I set a trigger on the feature info widget to:

pan to 1 Selected

show on map 1 Selected

Zoom to 1 Selected

Lorraine77_2-1664461803651.png

But when I click on a point on the map it doesn't zoom to the point.

Lorraine77_3-1664461906349.png

I also tried selecting a point but it won't zoom to it automatically when I select the point:

Lorraine77_4-1664461990704.png

 

 

0 Kudos
BrunoSousa1
New Contributor III

To zoom in to a feature in a Map Widget, the action has to be triggered from another Widget, such as List Widget. Feature Info is also capable of triggering actions. You have to set up these actions under Message Action, not Data Action. However, I don't believe you you will be able to zoom in to a point just by clicking on it, since you can't send a Message Action to the same Widget that triggered it. But we can work around this.

ESRI should come up with a more elegant solution (if there is one I don't know), but to acomplish this behaviour you should: 

1. Create a new webmap that contains only the layer you are trying to select (e.g. points layer), remove basemap;

2. Add a second Map Widget (Map2) to your Experience (anywhere) and connect it to your new webmap;

3. Select your first Map Widget and add an Action to it this way:

 a) Add a trigger;

 b) Record selection changes

 c) Widgets/Map 2

 d) Zoom to

 e) Select data - Select the point layer within the main Map Widget.

4. Select your second Map Widget (Map 2) and add an Action to it like this:

 a) Add a trigger;

 b) Extent changes;

 c) Widgets/Map

 d) Zoom to

5. Try it out and see if when you select a point, the map will zoom to it. It might not work at first, if it doesn't save and refresh the page.

Let me know if you end up trying this.

LayerItOn
New Contributor III

You, my friend, have saved me so much time. I did not realize it was the Message Action that controlled the zoom. That feels counterintuitive but I am glad that I found your comment! 

MelissaJankovic
New Contributor II

I tried this and it requires 2 map widgets.  One that triggers the other.  It also requires that both maps be visible in experience builder.  Is this what you describe in your instructions?  I am looking to select a point in a map widget and have it Zoom to that point.  2 map widgets add more confusion not clarity to my "experience"

 

Mel

BrunoSousa1
New Contributor III

Hi. The second map does not have to be visible. Hide it behind the main map, or anywhere else. 

0 Kudos
L77
by
Occasional Contributor

Experience builder is really confusing to use compared to web app builder. I don't think Experience builder is ready yet and am dreading having to use it. I'm going to see if there are other options because these tools are really not intuitive and I don't want to spend several days trying to recreate what I already built in web app builder.

0 Kudos