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 it is not working
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...