Select to view content in your preferred language

URL Parameter Selection Type ID Zoom and Pop-Up

264
2
07-09-2024 09:53 AM
Labels (1)
Hornblower5953
New Contributor II

Wanted to create a URL Parameter that I could use in my Access database so the user selects a site, the map then zooms to the site and opens the pop-up like it did in the WAB.  It's been difficult to figure out what gets encoded and what doesn't .

In Experience Builder:

Search Widget
Added a trigger in Action so the map zooms to the record selection.  The pop-up is configured in the underlying map.

Select On ID Parameter

experience.arcgis.com/experience/AppID/#data_s=id%3AdataSource_1-LayerName_LayerID%3AObjectID  

%3A are the :

WHY DOES THIS HAVE TO BE ENCODED?  WHEN I USE THE CENTER PARAMETER THE : IS NOT ENCODED?!?!?!?!?

dataSource_1-LayerName_LayerID

example: dataSource_1-MySites_2366%3A432

I extracted the data source layer name and ID from the URL after doing a search on the layer I wanted.  You can reveal this by turning it on in Manager URL status in Experience Builder.

The map zooms to the feature and the info pops up, no need to center the map.

BUT if you DID want to center the map on a particular lat, long...

experience.arcgis.com/experience/AppID#widget_2=center: lat%2Clong%2CWKID

NOTE: NO / AFTER THE APP ID!

widget_2 is the map widget ID so don't go looking for your map widget ID having the word "map" in it like I did.  You can reveal this by turning it on in Manager URL status in Experience Builder.

%2C = ,

LAT LONG DOES NOT HAVE TO BE ENCODED OR YOU CAN ENCODE EVERYTHING FOLLOWING CENTER: AND IT STILL WORKS, BUT THE COMMAS BETWEEN X AND Y AND WKID MUST BE ENCODED.

LAST:  My understanding is this zoom feature will only work with the ID selection parameter and doesn't work with the WHERE selection parameter (which I've yet to figure out).

2 Replies
JLopezMB
New Contributor

I'm working on something similar with Experience Builder. I'm not using url parameters though. I just want to Zoom To when a record is selected in a related table.  The Relationship Class that was in the ArcPro Map does not seem to have carried over to Experience Builder. 

Thanks for posting the links!

0 Kudos
TimWestern
Occasional Contributor II

"WHY DOES THIS HAVE TO BE ENCODED?  WHEN I USE THE CENTER PARAMETER THE : IS NOT ENCODED?!?!?!?!?"

Experience builder has some features in it that sanitize data to avoid cross site scripting and injection attacks .  I assume that's what you mean when you say encoding.

here is a handy site with some of the HTML codes for encoding various symbols:

https://www.w3schools.com/tags/ref_urlencode.ASP


0 Kudos