[OpenLayers-Users] interactive change min/maxScale properties

gabriel gpetricek at gmail.com
Thu Jan 10 01:51:46 PST 2013


Hi guys, 

im trying to interactive change properties min/maxScale of ol.layer.WMS
constructor. 

there is my test code: 
--------------------

function to redraw layer and set maxScale on button click : 

function zmenaMierky()
   {
     newScale = 50000;
     krajSK.maxScale=newScale;
    
     if(krajSK.maxScale=="")
         console.log("not defined")
     else 
         console.log(krajSK.maxScale)
    
    krajSK.redraw(true);
   }

Code for WMS layer: 
var krajSK = new o.Layer.WMS("kraje","http://localhost:8080/geoserver/wms",
{layers:"layer"}, {singleTile:true, minScale:2000000, maxScale:newScale});

when i click on the button, the console says, that maxScale property has new
value (50000) and layer was refresed. 

But nothing changed while zooming. I can go deeper as 1:50000. Where am i
making a mistake(s)? 

Best regards




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/interactive-change-min-maxScale-properties-tp5026568.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list