<div dir="ltr">If you set the min and max scale to a layer, this will not be showed outside this parameters. <div>The layers is instaciented there, but not visible because you determined the scale that will be visible. </div>

<div>There is no problem with that, the program is working fine as you demand, only logic fails. </div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><p style="font-family:Corbel,Arial,Helvetica,sans-serif;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px">

</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"></p><p style="font-family:Corbel,Arial,Helvetica,sans-serif;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px">

<table style="width:400px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px;color:rgb(51,51,51)"><tbody><tr><td><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:16px">

<strong style="color:rgb(28,119,155)">Fernando Norte</strong></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Desenvolvedor SIGWeb</p><p style="margin-top:20px;margin-right:0px;margin-bottom:0px;margin-left:0px">

tel.(31) 2533.9900</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">cel.(31) 9119.8814</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">skype: fernandoglobalgeo</p>

</td><td><img src="http://globalgeo.com.br/assinaturas/logo.png" border="0" style="display:block;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"></td></tr></tbody></table></p><p style="color:rgb(51,51,51);font-size:12px;margin-top:20px;margin-right:0px;margin-bottom:0px;margin-left:0px">

Endereço: Alameda do Ingá, 88, 6º andar, Vale do Sereno</p><p style="color:rgb(51,51,51);font-size:12px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Nova Lima/MG - CEP: 34.000-000</p><p style="color:rgb(51,51,51);font-size:12px;margin-top:5px;margin-right:0px;margin-bottom:30px;margin-left:0px">

<a href="http://www.globalgeo.com.br/" style="color:rgb(28,119,155);text-decoration:none;font-weight:bold" target="_blank">www.globalgeo.com.br</a></p><p style="color:rgb(51,51,51);font-size:9px">"O presente documento pode conter material confidencial ou seu sigilo é protegido por lei.<br>

Quaisquer informações nele contida são destinadas exclusivamente ao(s) seu(s) destinatário(s)<br>não devendo em nenhuma hipótese ser repassado a terceiros".</p><p></p><p></p><p></p></div>
<br><br><div class="gmail_quote">2013/3/20 gabriel <span dir="ltr"><<a href="mailto:gpetricek@gmail.com" target="_blank">gpetricek@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi List,<br>
<br>
i got this problem. Im trying dynamically change min and maxscale for<br>
layers. So for start i set maxScale=100000.<br>
var layer = new o.Layer.WMS(name, url, {params},{...maxScale:100000,<br>
minScale:500000});<br>
<br>
Then i add value 150000<br>
<br>
/*button onclick event*/<br>
layer.maxScale = document.getElementById("maxScale_value").value; //150000;<br>
<br>
OK , everything works fine. I can see layer from scale 500K to scale 150K.<br>
But when i change the value less then maxScale. for example to 50 000, it<br>
doesnt work. i can see layer from 500K to 100K.<br>
<br>
Then i tried something like this:<br>
var layer = new o.Layer.WMS(name, url, {params}); // without max/minScale<br>
<br>
map.events.register("move", map, function(){<br>
 if(layer.maxScale == 500) // this is the default maxScale value<br>
 {<br>
   layer.maxScale = 100000;<br>
   layer.minScale = 500000;<br>
 }<br>
})<br>
<br>
and then the same button click event<br>
<br>
layer.maxScale = document.getElementById("maxScale_value").value; //50000;<br>
<br>
That is working for me. But there is another new problem. If i have layer in<br>
scales from 100000 to 500000 and i zoom to scale 525000 i cant see the layer<br>
(that's good), but when i launch browser console (F12), in Network list i<br>
can see, that the layer is still loaded in background.<br>
<br>
Any idea how to avoid this problem?<br>
<br>
Best regards.<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Min-MaxScale-problem-tp5041701.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/Min-MaxScale-problem-tp5041701.html</a><br>
Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br></div>