AnsweredAssumed Answered

Filter layers in Web Map with a URL parameter

Question asked by sjacksonesriaustralia-com-au-esridist Employee on Nov 18, 2017
Latest reply on Nov 29, 2017 by Confare
  • I have a polygon regions layer.
  • I have a number of other layers that have already been pre-clipped to these regions
    • The region ID is included for every feature

 

Bit like this, the boxes are the regions:

End goal:

As a user, I want to choose a region from a dropdown, and then this opens a web map/web app with only the relevant features being shown and centered into the relevant bounding box for that region.

 

The bit I am struggling to work out, is a good approach to do the bit in red above.  Everything else is ok.

 

Some ideas:

  • I could automate creating a series of web maps with relevant filters applied to each of the layers, and then I could use the relevant Web Map ID in a URL parameters. 
    • I don't like this, as will end up with lots of web maps and will be tricker if I need to update a popup/style for all of them. 
  • I was hoping that I could apply a filter to all of the layers in my web map purely through using a URL parameter.  I do not think this is possible?
  • AppBuilder might be a bit of a heavy app for this, but even with a hidden filter widget, I do not think I can use a URL parameter to call an app to filter all layers with a def query. 
  • If I was to go down the JS API route, it looks like I could possibly achieve what I want with featureLayer.setDefinitionExpression="regionID"

 

Just looking to brainstorm any ideas or send me some relevant links so I can do some homework before going down the wrong path.  Thanks!

Outcomes