Select to view content in your preferred language

DynamicLayerInfos: Changing MinScale Not Working

2775
2
Jump to solution
01-08-2014 02:12 PM
Labels (1)
RyanCoodey
Frequent Contributor
I'm building a little settings dialog window to allow users to dynamically change a few settings, mainly the layers scale and the layers labeling scale. This dialog is working fine for both the labeling min and max scales, and also working fine for the layers max scale. But changing the min scale has no effect though... Is this perhaps a known bug? I have checked over the code numberous times and the DynamicLayerInfos min scale is indeed changing. Perhaps there is something else I am missing? The Layers resolution is min = 0 and max = Infinity.

Here is a code snipet:
Layer.DynamicLayerInfos = Layer.CreateDynamicLayerInfosFromLayerInfos(); foreach (LayerInfo layerInfo in Layer.DynamicLayerInfos) {     layerInfo.MaxScale = MaxLayerScale;     layerInfo.MinScale = MinLayerScale; } Layer.Refresh();


The service layer does live inside a client side GroupLayer, and there are also group layers in the map service. But no settings are being set on the client Group and as the code snipet shows, I am setting the same min on all layers including the groups.

Running the 10.2 API against a 10.1 server.

Thanks a lot for any help or info!
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
I don't reproduce your issue.

Note that by setting LayerInfo.MinScale/MaxScale you can reduce the scale range defined at server side but you can NOT extend this scale range.
For example if a sublayer at server side is published with a scale range of [0; 1:10000], there is no way to get the sublayer displayed at a scale larger than 1:10000 even if you change the client MaxScale (Note: I mean no way with an ArcGISDynamicMapServiceLayer, you can get the features displayed with a FeatureLayer).

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
I don't reproduce your issue.

Note that by setting LayerInfo.MinScale/MaxScale you can reduce the scale range defined at server side but you can NOT extend this scale range.
For example if a sublayer at server side is published with a scale range of [0; 1:10000], there is no way to get the sublayer displayed at a scale larger than 1:10000 even if you change the client MaxScale (Note: I mean no way with an ArcGISDynamicMapServiceLayer, you can get the features displayed with a FeatureLayer).
0 Kudos
RyanCoodey
Frequent Contributor
Note that by setting LayerInfo.MinScale/MaxScale you can reduce the scale range defined at server side but you can NOT extend this scale range.


Thanks so much for that info Dominique! That sounds exactly like what I am experiencing. Unfortunately that is exactly the functionality our users are asking for :(. The default scale range is set low, because there is lots of data in close proximity, but as they filter data out (turn off other sub-layers) they would like to have the option to increase the range.

I suppose I could republish the service at a higher scale (or at all scales) and then set the scale lower after load. And I don't think a FeatureLayer will work great because there is a good amount of data and no labeling (when zoomed in).

Hmm, bummer... If anyone can think of any other workarounds, I'd love to hear them.

Thanks again Dominique!
0 Kudos