Frequently asked question

Is it possible to set a zoom level on a web map configured with ArcGIS API for JavaScript?

Last Published: April 25, 2020

Answer

In ArcGIS API for JavaScript, the level of detail (LOD) of a web map can be controlled by creating a set of constraints using the array parameter. The LOD of a map is predefined in a way that the number zero (0) is set as the full extent and the number increases according to the number of zoom-ins performed, for example, if the user zooms in 13 times, the LOD is level 13. The array parameter can then be set to only display the map service within the selected LOD. The following script describes an array parameter to set the LOD to display the map service from level 11 until level 15 of a map.

displayLevels: [11, 12, 13, 14, 15]

The following web help document demonstrates how to specify the LOD in a web map, ArcGIS API for JavaScript: Specify LODs (level of detail).
However, by specifying the level of LODs, the zoom function is not limited to the set constraint. The zoom function is still functional, and the user can still zoom to the minimum level (0) and the maximum level of a web map (23).

The blog post, ArcGIS Blog: Web map zoom levels updated describes the levels' resolution and scale detail.

In conclusion, the zoom function cannot be restricted to the defined LODs, but the display of the data or map services can be.

Article ID:000018002

Software:
  • ArcGIS API for JavaScript 4 x
  • ArcGIS API for JavaScript 3 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic