Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am new to programming in JSAPI.

I have two dynamic layers and I want to set the property setMinScale(scale) and setMaxScale(scale) to layers so how do I Set ?

ex. I tried using layer.setMinScale(0) but its not working

any help would be appreciated.. thanks in advance : )

share|improve this question

1 Answer 1

up vote 0 down vote accepted

it have to be maxScale or minScale for your layer defination as following example. more info is on arcgis javascript doc. site....

maxScale

The maximum visible scale for each layer in the map service. If the map is zoomed in beyond this scale the layer will not be visible. A value of 0 means that the layer does not have a maximum scale. This property is only available for map services published using ArcGIS Server 10 SP1 or later. Code snippets:

dynamicLayerInfo.maxScale = 1000000;

dynamicLayerInfo.minScale = 0;

.

minScale

The minimum visible scale for each layer in the map service. If the map is zoomed out beyond this scale the layer will not be visible. A value of 0 means that the layer does not have a minimum scale. This property is only available for map services published using ArcGIS Server 10 SP1 or later. Code snippets:

dynamicLayerInfo.maxScale = 1000000;

dynamicLayerInfo.minScale = 0;

i hope it helps you...

share|improve this answer
    
Hi Aragon, thanks for your reply. I tried according to API doc. layer1.maxScale = 1000000; layer1.minScale = 0; also check the REST link for scale its showing minimum scale 1.47914381 & max. scale is 4513.988 Let me add code here –  Sunil Oct 17 '12 at 8:12
    
var dynamicMapServiceLayer1 = new esri.layers.ArcGISDynamicMapServiceLayer("myserver:6080/arcgis/rest/services/layer11/MapServer";,{"opacity":0.25}); dynamicMapServiceLayer1.setVisibleLayers([0,1]); dynamicMapServiceLayer1.maxScale = 50000; dynamicMapServiceLayer1.minScale = 0; map.addLayer(dynamicMapServiceLayer1); // Is my code is wrong ??.. please let me know.. thanks –  Sunil Oct 17 '12 at 8:20
    
Hello All, Its resolved . I have customized my code as per instructions given by @Argon thanks Argon..Please check following link also forums.arcgis.com/threads/… –  Sunil Oct 18 '12 at 7:12

Your Answer

 
discard

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.