Select to view content in your preferred language

URL Parameters to Filter

5176
13
Jump to solution
09-27-2022 01:06 PM
Labels (1)
ArielLow2146
Frequent Contributor

I have a layer with many polygons. I want to try to avoid creating a map/app for each polygon and thought that one way to do that would be to use URL parameters to filter the map and zoom to that polygon. 

I've been able to configure URL parameters to select/highlight a feature and to zoom (&district=6&level=14) but I haven't been able to:

  • Center on the selected feature without manually specifying lat/long
  • Filter out the other features
  • Not have the pop-up appear when the feature is selected (with the Media map)

Are either of these possible? I'd be open to using the Media Map, Minimalist, Basic, or Sidebar.

1 Solution

Accepted Solutions
RandyMcGregor3
Frequent Contributor

I have hit the same issue. I can zoom to a feature in an app with url parameters but all other features are still visible and zooming to polygons is kind of messy.

If I understand correctly, the filtering you are describing can be done with a dashboard with available parameters. If a dashboard does not work for you, then this isn't helpful, but if it's a possibility:

https://doc.arcgis.com/en/dashboards/latest/create-and-share/url-parameters.htm

 

View solution in original post

0 Kudos
13 Replies
MCameron
Esri Contributor

Hi @ArielLow2146 

I am not sure if what you are trying to do is possible, however as an alternative, you could configure a Web App Builder application with URL Parameters to center on a feature based on a field (e.g. a Reference Number or Unique ID) of the feature within the layer. 

You can find details on how to do this here: https://communityhub.esriuk.com/technicalsupport/2016/10/31/url-parameters-in-web-app-builder 

 

Hope this helps! 

0 Kudos
ArielLow2146
Frequent Contributor

@MCameron I followed the instructions on the link you shared and it produces the same functionality as the URL parameters for Instant Apps do which is not the functionality I want. I don't see any way to filter using URL parameters with WAB unless group filter is set up.

Can you clarify what you're suggesting and how it addresses the bullets I laid out in my original post?

0 Kudos
RandyMcGregor3
Frequent Contributor

I have hit the same issue. I can zoom to a feature in an app with url parameters but all other features are still visible and zooming to polygons is kind of messy.

If I understand correctly, the filtering you are describing can be done with a dashboard with available parameters. If a dashboard does not work for you, then this isn't helpful, but if it's a possibility:

https://doc.arcgis.com/en/dashboards/latest/create-and-share/url-parameters.htm

 

0 Kudos
ArielLow2146
Frequent Contributor

Thanks Randy. We originally weren't using Dashboard because it doesn't have the ability to limit navigation extent or prevent zoom scrolling but as you mention it is the only app that can do filtering with URL parameters.

Ended up combining the Dashboard URL filtering with some effects to create a masking look and feel.

0 Kudos
RandyMcGregor3
Frequent Contributor

Glad it worked out. Every ESRI app does 50% of what I need. None do 100%!

KellyHutchins
Esri Frequent Contributor

In two apps (Media and Sidebar) there is now a url param you can define that will allow the custom url params defined in the app config to work as a filter instead of a single popup. This is there for testing to see how this feature might be used in various apps. 

In this example the map will zoom to Texas and show the popup 

https://jsapi.maps.arcgis.com/apps/instant/sidebar/index.html?appid=1dad0c5cf8244ce3ae901bca3fd3c10a...

 

Here the map is filtered and only Texas is shown and no popup displays 

https://jsapi.maps.arcgis.com/apps/instant/sidebar/index.html?appid=1dad0c5cf8244ce3ae901bca3fd3c10a...

We'd like to include this capability as part of the url param configuration in a future release so any feedback on how this works (or doesn't) for your use cases would be helpful. 

 

TomasL44
Emerging Contributor

@KellyHutchins How did you get the popup to not be visible yet the feature is still highlighted in the second example? I have configured a sidebar instant app with a URL Parameter but when i use it the feature is not highlighted and the popup is displayed.  I would like my results to look as yours do in the second example...zoomed to feature, popup is not visible and the feature is highlighted in cyan. How would i accomplish this? 

0 Kudos
TanGnar
Frequent Contributor

@KellyHutchins The filter option (illustrated with second link) would be very helpful. I have a URL parameter right now and the filter option would be ideal because I don't need it to make the selection or add the selection outline and fill, or initiate a popup. 

Ideally, the response to the URL parameters would be configurable enough to turn some of these things on and off. For example, I may want to make the selection with url parameter and show the popup, but not have the fill (because it covers up the symbology I have set, which is important). This could also be solved by an option to adjust opacity of the selection colors. Or to have the filter and the popup. etc.

Edited to add that applying the filter option to multiple layers would be great.

Edited again to express support for turning off the popup when the url parameter is applied. 

TanGnar
Frequent Contributor

@KellyHutchins 

Hi Kelly, I have an app using &urlParamAsFilter=true and the functionality recently changed (assuming this recent update). The url param still filters, but it no longer zooms to the extent of the feature. 

I'm a bit stuck now - either I can filter and not have popup, or I can zoom and figure out how to deal with the selection and popup. 

Do you have any insight about whether this is a bug that will be fixed, or if there are other options now? 

0 Kudos