4

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!

1
  • Further Clarification I am setting the visibility dependent on scale level. So, for like a parcels layer, I set it not to be visible at a smaller scale than 1:10,000 (MinScale) or so. However, by default (defaultVisibility), the layer is visible, but it is not visible at that scale. In a FeatureLayer, I get access to that MinScale property so I can check it against my current scale and adjust my control accordingly. Trying to find that property or something that tells me whether the ArcGISDynamicMapServiceLayer is visible at the current scale is what I am looking for.
    – Branco
    Jul 16, 2014 at 19:11

2 Answers 2

1

So, after consulting here and on ESRI's GeoNet, I have come to the conclusion that for some reason ArcGIS Server 9.3.1 does not pass the information to the JavaScript API that I require. A user on GeoNet compared their up-to-date server against my slightly aged one. They have the required properties while I do not.

Just another reason to convince my boss to upgrade our server. By the way...@Steve is somewhat correct, but not for my version.

0

Wouldn't you just set the scale dependent visibility in the mxd that you are publishing?

4
  • I am doing that, but for an ArcGISDynamicMapServiceLayer, I cannot tell if the layer is visible at the current scale. I am able to do it using a FeatureLayer by comparing FeatureLayer.MinScale against Map.getCurrentScale, but I want to do the same idea with an ArcGISDynamicMapServiceLayer. I haven't found the right property for the dozen or so layers I have that make up my ArcGISDynamicMapServiceLayer. I can assign individual FeatureLayers to each layer of my map service, but I would prefer not to due to my symbology issue.
    – Branco
    Jul 16, 2014 at 19:13
  • would developers.arcgis.com/javascript/jsapi/… help?
    – Steve
    Jul 16, 2014 at 20:21
  • No unfortunately. It just shows my ArcGISDynamicMapServiceLayer as being visible. It does not reflect which of those layers within the ArcGISDynamicMapServiceLayer are visible at the current scale or not.
    – Branco
    Jul 21, 2014 at 18:12
  • I tried looking through the layerInfos property of each layer but that only shows DefaultVisibility. I was just hoping someone knew of a way or method to access scale visibility for each individual layer of the ArcGISDynamicMapServiceLayer like I can in the FeatureLayer.
    – Branco
    Jul 21, 2014 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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