Share widget: 'Query a feature and zoom to it' option

453
5
08-22-2019 08:13 AM
KellySchon
New Contributor II

I have the share widget in one of my web apps and am trying to get it to generate a link based on the querying of a feature that will zoom in to the query result when it opens. Everything is working, but when you use the link it creates, instead of zooming to the full extent of the selected feature it seems to be zooming in to the geographic center of the feature (I'm working with relatively large polygons). If you then click the "Zoom to" button on the pop up, it will pull back to the entire extent of the feature, but it doesn't do it automatically. 

Is there any way I can get rid of the need for that second click and have the URL automatically go to the full extent of the feature? I attached pics as an example of what I'm seeing.

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Kelly,

  So your share widget link has the query key word in the url (i.e. blah blah/?query=SCPA_External_Parcels_2019_FC_6413,PARCEL,1321315NW00002150)?

0 Kudos
KellySchon
New Contributor II

Yes, from my example above, after our domain name the parameter part of the URL is

"/index.html?id=[the web app's item ID]&query=General_Map_Layers_6742_1%2CNAME%2CBarbour"

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Kelly,

   Are you using AGOL WAB or WAB Developer?

0 Kudos
KellySchon
New Contributor II
0 Kudos
KellySchon
New Contributor II

I talked to tech support and apparently, it's a bug in the Share widget. They created an enhancement for it to be able to accept two parameters at once (query and scale) rather than having one overrule the other the way it does now.

"ENH-000119500: Use of "Query feature" parameter with "scale level" parameter, or use of more than 2 URL parameters depending upon the desired functionality"

For now, my users will just have to make that second click on the Zoom to button after opening the app if they want to see the full extent of the feature.