Unable to zoom to layer extent in web app/map

10-31-2022 02:49 PM
by Anonymous User
Not applicable

I am unable to zoom to the layer extent of layers in the Layer List in an ArcGIS Online web app and the web map that it is based upon. 

When I zoom to the extent of layers in the layer list, they don't zoom to the extent of all features contained within the layer, but the behavior is completely random. For some layers, the map zooms to the area west of central Africa (0,0). For other layers, the map will zoom to a random small region where a part of the layer's features are located. And for others, the map just zooms out to show a large portion of the Earth. 

All of these layers are continuously updating with new data every hour. I would like to zoom to the extent of layers based upon the extent of features that are currently within the layer and not to a random area like stated above. Therefore, the extent of features in the layers will change across time since updates and insertions are made to the features in these layers at every time interval. 


I have tried:

1) changing the 'extent' property of the layer using ArcGIS Online Assistant

2) changing the 'initialExtent' and 'fullExtent' properties using the ArcGIS REST API's updateDefinition method on the layer. I was able to change the 'initialExtent' successfully using this method, but not the 'fullExtent'. Regardless, none of these two approaches changed the zoom extent of the layer when you click on 'zoom to' on the web map/app. 

3) changing the 'initialExtent' and 'fullExtent' of the layers manually using the ArcGIS rest services admin console on the web. Again, I was able to change 'initialExtent' here fine but the 'fullExtent' wouldn't update even after receiving a success message. 

4) 'Rebuild Spatial Indexes' of the layer in its Settings in AGOL

None of these have worked.


I have seen this problem showing up several times when new hosted feature layers get created in AGOL and have features written to them- that the 'zoom to' functionality zooms to the wrong area/location. 


Any help would be greatly appreciated. 



0 Kudos
0 Replies