Hello,
On Wed, Mar 20, 2013 at 1:36 PM, gabriel <[email protected]> wrote:
>
> i got this problem. Im trying dynamically change min and maxscale for
> layers.
>
Here's what I would do:
layer.setVisibility(false);
// wipe everything related to resolution / scale
layer.minScale = layer.maxScale
= layer.minResolution = layer.maxResolution
= layer.numZoomLevels = layer.resolutions
= layer.scales = undefined;
// set new values
layer.options.minScale = 15000;
layer.options.maxScale = 500000;
// trigger calculation with new values
layer.initResolutions();
layer.setVisibility(true);
layer.redraw(); // necessary ??
I haven't tested but it should work.
--
Damiano ALBANI
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users