AnsweredAssumed Answered

JavaScript API - ArcGISDynamicMapServiceLayer SubLayer Scale Dependency Visibility

Question asked by bwcoleman18_1 on Jul 16, 2014
Latest reply on Jul 22, 2014 by jeff.pace

Background:

I am building a JavaScript web app using ESRI's JavaScript API v3.8, and our ArcGIS Server v9.3.1. I have layers I am rendering using the ArcGISDynamicMapServiceLayer, and I have been trying to find a way to access scale dependency visibility and have only been able to access the defaultVisibility.

Not Preferred Solution:

Using FeatureLayer for each layer allows me to check the MinScale against the map's current scale to determine whether the layer can be visible at that scale. I am trying to find a way to do this comparison using an ArcGISDynamicMapServiceLayer since it renders symbology based off of my map template or MSD file.

I would prefer to avoid setting up a dozen or so layers using FeatureLayer because I have to render each layer's symbology individually, since I am using ArcGIS Server v9.3.1, and it does not render it for me like 10.x+. This becomes tedious when I have a dozen or so layers each with a few class divisions.

Goal

I am using checkboxes for layer visibility, and if the layer isn't visible at the current scale, I am disabling and clearing the checkbox. I am using this as a way to tell the user that the layer isn't visible at this scale. A disabled control should be easier to understand than having a 'checked' checkbox and no layer showing up.

Anyone run into a similar situation? I am just trying to avoid coding in the symbology for all the layers as FeatureLayers.

Thanks!

Outcomes