ArcGIS Online Instant Apps Set Initial View/Extent
The Problem
If you’ve used ArcGIS Instant Apps before, you know that your underlying web map defines the initial view in the instant app. That is to say, if you set the initial view on your web map, the instant app will inherit that initial view.
However, if you use navigation boundaries the initial view will no longer be inherited from the underlying web map but instead will be at the center of your navigation boundary. This is fine if your navigation boundary happens to align with what you want your initial view to be like illustrated below.
But if your desired initial view is offset from the center of the navigation boundary like below, you’re going to have an issue.
An example of this can be seen below. The navigation boundary is set to the entire Great Lakes region, so the initial view is set to the center of that extent. However, in this example I would like to center the initial view on the state of Wisconsin which is on the left side of the window.
The Solution
The solution is to add the center and zoom level parameters such as ¢er=-89.9283;44.8694&level=7
to the URL. When those parameters are specified in the URL, the result is an initial extent in the desired area, in this example Wisconsin, as seen below.
There are far more URL parameters than just center and level, so if you want to learn more check out the URL parameter documentation. There is also an extent parameter which I thought would be even better than the center and level option, but unfortunately it seems like it doesn’t work on instant apps where the navigation boundaries are set.