[OpenLayers-Dev] minZoomLevel and WFS

Andreas Hocevar ahocevar at opengeo.org
Fri Jun 12 05:03:11 EDT 2009


Hi Matt,

you do not need minZoomLevel, because you can control if layers should
be displayed using layer.minResolution and layer.maxResolution -- for
all layer types:

        "The minZoomLevel property is only intended for use " +
        "with the FixedZoomLevels-descendent layers. That this " +
        "wfs layer checks for minZoomLevel is a relic of the" +
        "past. We cannot, however, remove it without possibly " +
        "breaking OL based applications that may depend on it." +
        " Therefore we are deprecating it -- the minZoomLevel " +
        "check below will be removed at 3.0. Please instead " +
        "use min/max resolution setting as described here: " +
        "http://trac.openlayers.org/wiki/SettingZoomLevels",

The WFS layer will not load data if not in the min/maxResolution
range. Apart from that, in the future you will probably want to use
Layer.Vector with Protocol.WFS and Strategy.BBOX instead of Layer.WFS.
See http://localhost/openlayers/examples/wfs-protocol.html for an
example.

Regards,
Andreas.

On Thu, Jun 11, 2009 at 3:09 PM, Diez, Matthew<Matthew.Diez at iem.com> wrote:
> Looking through the Layer.WFS source, i saw:
>
>  //DEPRECATED - REMOVE IN 3.0
>          // don't load data if current zoom level doesn't match
> -        if (this.options.minZoomLevel &&
> -            (this.map.getZoom() < this.options.minZoomLevel) ) {
> -            return null;
> -        };
>
> So, if minZoomLevel is going away, why? And what is the preferred strategy
> for dealing with not loading WFS layers at certain
> zoomLevels/scaleDenominators?
>
> -Matthew D. Diez
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
>

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Dev mailing list