Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In ArcGIS JS API, I would like to know and display the scale of a dynamic service layer by using the onExtentChange event, but the LOD argument is only valid for tile map services. Is there an equivalent way for dynamic map services?

share|improve this question
up vote 1 down vote accepted

The scale property applies to the map, not the individual layer, so you can use map.getScale() to display it.

You can get the map's level using map.getLevel(), but as you identified this only applies if there is a tiled layer in the map.

share|improve this answer
Thanks, was introduced only in 3.1, and I am only using 2.8. Is there be an alternative way prior to 3.1? – NeoJigglypuff Oct 15 '12 at 5:58
@NeoJigglypuff not sure, sorry. Is there any reason why you can't just upgrade? I've found it to be a very seamless process. Basically, you just need to change the reference from 2.8 to 3.x, noting that you'll need to use a local web server (rather than files in the file system) for local testing. See the migrating doco for details – Stephen Lead Oct 15 '12 at 6:07
Upgrading from one version to another, though as simple as it may seem, will have an effect on all of our applications, with the retesting and QAs involved. Though it's good to know that a getScale method is present in 3.1. Thanks again. – NeoJigglypuff Oct 15 '12 at 6:35
There's also esri.geometry.getScale which has been around longer than esri.Map.getScale:… – Derek Swingley Oct 15 '12 at 7:33
That works for me. Thanks! – NeoJigglypuff Oct 16 '12 at 0:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.