Select to view content in your preferred language

Use URL Parameter to Zoom to Feature?

5423
23
Jump to solution
03-09-2022 11:32 AM
Labels (1)
JessicaWeinberg
New Contributor III

The Interactive Legend Instant App allows the use of URL parameters, but I can only figure out how to use them to highlight a feature/open its pop-up. How can I get it to also zoom in to that feature specified in the URL?

Basically, I'm looking for functionality equivalent to what's available in the Basic Viewer Configurable App, since it seems like Configurable Apps are being retired. If it isn't to be found in Instant Apps, is there another App I should try?

Tags (1)
23 Replies
KellyHutchins
Esri Frequent Contributor
Are there any errors in the developer console? I wonder if its due to the spatial reference in your app?
0 Kudos
CMV_Erik
Occasional Contributor

Good question. Assuming that would be Inspect > Console in my browser (Microsoft Edge), I get two errors when I reload the page:

  • One message about watchUtils being deprecated appears with every Sidebar app for me, so I'm assuming it's not relevant. 
  • The problem app has an additional error with the top line "CALCITE-POPOVER: reference-element id "landing-panel__snappingButton" was not found. "

 

The underlying map allows me to use a center parameter with an argument specifying WKID 102000, which I thought applied to all maps created in AGOL. I'm not sure if that addresses your spatial reference question, but I can confirm the problem occurs with or without using the center parameter.

0 Kudos
KellyHutchins
Esri Frequent Contributor

I think you said your app wasn't public? Is your map? I'd be happy to take a look if you want to email me the link. (Khutchins@esri.com)

0 Kudos
KellyHutchins
Esri Frequent Contributor

 

Erik provided me access to the test app and we were able to determine that the URL params don't work in Sidebar if a navigation boundary has been defined. This is a problem in the app that we'll address in the next update of ArcGIS Online. 

 

 

MappyIan
Occasional Contributor II

Hi @KellyHutchins, I've encountered the problem where the 'level' URL parameter doesn't work when the 'map area' is configured in the Sidebar instant app (note that it seems to be a problem with the 'map area' being configured, disabling the 'navigation boundary' didn't resolve the problem.  I'm wondering if you have any timescale for when this might be fixed as it's been over a year now?

Any update would be very welcome, thanks!

0 Kudos
RandyMcGregor3
Occasional Contributor III

Should query or showLayers work in Instant Apps?

0 Kudos
JessicaWeinberg
New Contributor III

Great to know, thank you! Yeah, it looks like the Interactive Legend app URL parameter feature doesn't behave like it does in the Media app. The popup shows and the feature is highlighted, as in the Media app, but there is no zooming to the feature. 

0 Kudos
KellyHutchins
Esri Frequent Contributor

You should be able to accomplish the same with interactive legend by using the level url param. Here's an example: 

https://jsapi.maps.arcgis.com/apps/instant/interactivelegend/index.html?appid=0696bb9aa10e42ab9860fd...

0 Kudos
JessicaWeinberg
New Contributor III

Thank you, I will do that for now. But different features will require different zoom values; it definitely complicates the process to have to specify that per feature.

0 Kudos
KellyHutchins
Esri Frequent Contributor

Yes we agree its definitely just a workaround. We are going to work on implementing zoom to feature as an option for a future release.