Spatial Query on ArcGIS Online Dashboard Application

2054
9
08-24-2021 10:05 AM
DInavolu
New Contributor II

I have two layers on my Dashboard App. One consists of polygons and other polylines with same map extent but have no common fields. I need to count the polylines present in the polygon when user clicks on one or polygon selection changed. I believe I need to apply spatial query for this but don't know how to do it on Dashboard

0 Kudos
9 Replies
jcarlson
MVP Esteemed Contributor

In the map widget settings, go to Layer Actions. For your polygon layer, select Add action → Filter. Select the other layer you want to be filtered, and set the Method to Spatial.

jcarlson_0-1629826892999.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
jcarlson
MVP Esteemed Contributor

Forgot to mention! If your layers are added from a Map Image layer, they're not going to behave as expected when used in spatial operations. Is this the case?

- Josh Carlson
Kendall County GIS
DInavolu
New Contributor II

As you can see in the image I attached to this question, I could not see "Render only when Filtered" option.  The polygon layer is a FeatureLayer. And when I tried to open the polygon layer using ArcGIS online MapViewer it said "The layer 'POLYGON' is not accessible by ArcGIS Enterprise. Thus, editing will be disabled on this layer". Is that the reason I could not apply Spatial Query?

0 Kudos
jcarlson
MVP Esteemed Contributor

That's very odd, but it sounds like it would be related. Where's the polygon layer coming from?

- Josh Carlson
Kendall County GIS
0 Kudos
DInavolu
New Contributor II

It is a private layer of my Organization.

0 Kudos
jcarlson
MVP Esteemed Contributor

I would go to the web map your dashboard is referencing and try to re-add the polygon layer. If possible, add it from the service URL, "your-org/server/rest/services/Hosted/some-service/0".

Make sure to include the layer index number so you get just the layer you want, not the grouped list of services. I have had layers behave differently when added directly from the layer's URL.

- Josh Carlson
Kendall County GIS
0 Kudos
DInavolu
New Contributor II

I initially added the layer using the index number. Now, again I added a new duplicate layer of same using index and got same message on MapViewer and same behavior in Dashboard. We're using Version: 10.71

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi @DInavolu

I have two layers on my Dashboard App. One consists of polygons and other polylines with same map extent but have no common fields. I need to count the polylines present in the polygon when user clicks on one or polygon selection changed.

You would configure this in the Map element > Configure > Layer Actions. It looks like you're in the correct configuration dialog.

I just tested this capability and the spatial query between layers is working for me. What error or issue are you seeing?


0 Kudos
DInavolu
New Contributor II

When I selected Spatial option in the configure dialog, it showed nothing to apply filter. 

0 Kudos