Customized scale levels in ArcGIS Server

781
3
05-20-2019 02:08 PM
BartPittari
New Contributor III

I've been trying to see if there's a way to essentially better translate desktop scaling levels to a web service.  I have a project that I'm supporting and, while you can zoom in or out on the .mxd side at most any scale, the most I've been able to find as far as scale references for the server-side is that, whatever you set, it increases/decreases by a factor of 2 (500,000 -> 1,000,000 as an oversimplified example) and if you want to scroll to 750,000 or something in between, it'll go to the nearest factor of 2 instead.

As a console output example from the service side:

myScale = map.getScale()
18489297.737236

** if I want to go to 5,000,000
map.setScale(5000000)
b.Deferred {promise: b.e…d.then, isResolved: ƒ, isRejected: ƒ, isFulfilled: ƒ, isCanceled: ƒ, …}
MyUtils.js:52 zoom-end event triggered


** the map zooms to nearest level to 5,000,000

myScale = map.getScale()
4622324.434309

Bringing the service into ArcMap is not practical since the page the service is on has a lot of customized menus and such that the end user utilizes when they do some analysis and make reports.  

Bart

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Bart,

   What you need to understand about the JS API is the Levels of Display (LODs) for the map are set by the Basemap that you use. So if you use a standard esri cached basemap then it has set LODs (zoom levels) that will not let you set the map scale to any scale besides those. No to understand the reasoning behind that you have to understand that a cached basemap is essentially a a collection of pre defined and exported images that make up a map and theses images are created for those predefined LODs (scales) and those images (tiles) are what is returned by the server to the client when the map service is used. Hope this helps clear things up.

0 Kudos
BartPittari
New Contributor III

Robert,

Thanks for the reply.  And yes, that's kind of what I figured.  What I was more wondering on the server side is if the zooming by a factor of 2 was able to be gotten around via some coding or specific types of scaling methods, or if that's just "how it is"?  In my digging, I'd come across an older snippet from this site saying as much (that the scaling up and down by double or half is just the behavior of the system).

Bart

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Bart,

  The API will zoom to the nearest LOD and that  is just how it is.

0 Kudos