I set the extent of my map under my Map Settings, but cannot figure out how to get the extent that I created to be used as the default when the map is loaded (i.e. if you click the home icon).
Nevermind. I did some more searching and it appears the only way to do this now is within AGO Assistant. Here's how:
There is an idea open that suggests re-implementing this functionality in AGO. Can you weigh in on what's going on, though, @RussRoberts? It would be great if that old blog post were at least updated with instructions for doing this in AGO Assistant if this functionality isn't coming back. If I didn't know a thing or two about JSON I would had no idea how to do this.
Interesting. I'm seeing why you have to copy it out now, because Ctrl+F doesn't scroll to the result. But at any rate, I just checked a map of mine and it's still there, one of the very last lines of code.
1. No need to copy it out.
2. Are you copying the right code block? There are two, if I recall correctly. One for data and one for metadata (?)
I'm also interested in setting the default extent of a map for viewing, not for searching. But I can't follow @wayfaringrob's steps. When I copy the JSON into a code editor, I can't find `initialState` or `viewpoint`.
What gives? Can anyone help me understand what's going on?
This is very helpful! Thank you!
This is about the coolest thing I've ever seen for AGOL. This is going to help me immensely.
I understand you want to set the extent at a very specific set of coordinates so your solution to editing the JSON is the best at the moment, but for those who come across this thread that want a particular view, but maybe don't need anything precise (i.e. eyeballing is good enough), you can create a bookmark. Then you can click the bookmark before you save to ensure the map saves at the appropriate extent (essentially it becomes your new home button).
So, regardless of what's going on under the hood, there could still be a way to offer the option of setting the "viewpoint," then, based on coordinates, no? In a similar fashion to setting extent in MVC? If the capability is there and modifiable in the JSON, why was the UI for making these modifications removed? It's just baffling to me that we now are told to rely on eyeballing it or knowing JSON when it used to be such a simple task and still could be. The disappearance of this functionality has been a headache.
Yup this is bc the application creates the extent based on 3.x older spec and the 4.x has been updated to use viewpoint. If we update the extent app to move to the New Map Viewer way this would impact classic based map viewer maps using this widget to define the extent.
@RussRobertsis the functionality described here available somewhere? Having to 'eyeball' several maps isn't very easy, nor does it result in a professional-looking product. I'm having trouble understanding why this was removed.
@RussRoberts, I'm not finding that setting to be particularly useful. I want an extent preserved, not a scale, and I don't want to have to carefully position my map each time I save. From this article, it sounds like the setting on the detail page used to control the default map extent. That's the setting I need. Is that available somewhere? The descriptions of the settings on the detail page and map properties are a little unclear, and neither seem to do what I need.
Oh I think I miss understood where you were setting the extent. the extent you set under the settings at the item level is just used for item searching.
If you want to preserve the map scale and viewpoint of the map you can set that within the map viewer. Checkout this doc link. If you view the map on 4.x web apps in desktop and mobile browsers both will have the same starting point without adjusting the scale when you set the save on the map with the view point. https://doc.arcgis.com/en/arcgis-online/create-maps/set-map-properties-mv.htm#ESRI_SECTION1_D2850B49151F445C962754F03AC7A5C3
Refrashing didn't work but when I view the map on a smaller screen size then it is zooming in to the extent that I set....I think that it may have to do with viewing the map on a really large monitor? On the big monitor it is looking at the correct area but with a lot of extra space surrounding the extent that I had set.
If you refresh the page after you save does it honor the set map extent?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.