Experience Builder recently (in the last release) included the ability to have a few different URL parameters. Honestly – URL parameters are nothing that I have used… but I’ve found that they can be really valuable to provide a targeted way to drive viewers to a specific feature or location.
If you want to look at the current URL parameters for Experience Builder, the documentation can be pulled up here: https://doc.arcgis.com/en/experience-builder/latest/build-apps/url-parameters.htm
If you peruse this list, you’ll see it’s short on map specific URL parameters. Notably, one of the questions/needs I had from a user was related to loading up a feature at a specific zoom scale.
Currently, Experience Builder does not include a URL parameter for an ‘extent’ or ‘scale’ – so it seemed that there was no way to load a selected feature and then ‘zoom to’ with a URL. Yet, using the ‘pages’ functionality of Experience Builder – there is a workaround for creating a standard app that also has a ‘url parameter zoom to specific feature’ functionality.
In my example – I have a basic web application showing the street network of San Bernardino County. The app works, but I also want the ability to send users to specific street segments when the app opens. So… how can I do it without the ‘zoom’ url parameter?
Here is the link to my app – feel free to play around with the parameters/URL as well: https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/
The first trick – is to use the ‘page’ functionality that is found in Experience Builder. After I have my application built out, I just duplicated it under the pages section.
You can then rename your pages, which will be used in the URL. After you have your second page created, go to the settings for the map object and modify the initial view of the map. It doesn’t matter where you focus on, just what zoom scale you use.
After you have done this, you are basically done. You can save and publish your app.
The first URL parameter is simply the ‘page’ parameter – my original/normal app can use the default URL, or the URL to the specific page as shown here:
https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Full
But if I want to drive users to a specific feature at the zoom scale I pre-defined, I need to use the other page that I created along with the details of the specific feature. For my app, the data, and my feature, that would look something like this:
https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Zoom?data_id=3b8b7d77...
If I want to change the feature that gets selected in the map, I can modify it manually, or you could do this programmatically as well. If you want to play with it manually, just modify the last characters in the URL following the ‘A’ character. This is the ObjectID for the feature.
For example, take the URL: https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Zoom?data_id=3b8b7d77...
Then replace ‘50965’ at the end of the URL string with ‘50089’, ‘32219’, or try any number!
That's it! Hopefully this helps a few people utilize URL parameters and a little Experience Builder trickery to create an experience that is tailored to your users needs.