[OpenLayers-Users] Min/MaxScale problem

Fernando Norte fernando at globalgeo.com.br
Wed Mar 20 07:33:05 PDT 2013


If you set the min and max scale to a layer, this will not be showed
outside this parameters.
The layers is instaciented there, but not visible because you determined
the scale that will be visible.
There is no problem with that, the program is working fine as you demand,
only logic fails.



 *Fernando Norte*

Desenvolvedor SIGWeb

tel.(31) 2533.9900

cel.(31) 9119.8814

skype: fernandoglobalgeo

Endereço: Alameda do Ingá, 88, 6º andar, Vale do Sereno

Nova Lima/MG - CEP: 34.000-000

www.globalgeo.com.br

"O presente documento pode conter material confidencial ou seu sigilo é
protegido por lei.
Quaisquer informações nele contida são destinadas exclusivamente ao(s)
seu(s) destinatário(s)
não devendo em nenhuma hipótese ser repassado a terceiros".



2013/3/20 gabriel <gpetricek at gmail.com>

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


More information about the Users mailing list