I am providing a web map to my co-worker (website administrator) for a project. The location of the project is dynamic and I need the embedded map to zoom to a feature instead of a set extent. Has anyone successfully done this?
Another option is to use the Minimalist configurable app. The Minimalist app is available in the configurable app gallery and can be configured to zoom to a specific feature via a url parameter. This app uses the same source code as the default ArcGIS Online embed app so it looks and acts the same.
Once you choose the Minimalist app from the gallery you can use the 'Custom URL Parameter' portion of the configuration panel to define the layer and field that contains the value you want to search for. In the example below we have a layer that has information about wildlife closures and I want to have the app zoom in automatically to a particular closure id. So I specify a url parameter name (this can be anything you want) and then select the layer (WildlifeClosures) and search field (ClosureID).
And here's the resulting test app. Note that when it loads it zooms automatically to the polygon with a closureId of 45.
Note that if you change the id in the url param and refresh the app it will zoom to the new location on page reload. For example here it zooms to closure # 16.
My goal is to avoid having to recreate the code every day as the project location is dynamic and the extent is changing daily. Zooming to feature would be awesome.
You can configure the search widget within the web map to search by layer. The user could search by an attribute and it will zoom to this feature.
Configure feature search—ArcGIS Online Help | ArcGIS
Retrieving data ...