Well, thanks for the nudge. I decided to start clean so I could give you as 
simple an example as possible, which made me realize I was actually testing on 
a WMS layer to avoid loading too much data. With a clean start I had to trouble 
getting a vector layer working as desired with maxResolution = 10.

However I am still unable to get the WMS layer to do the same or similar. I 
don't need this as much as I'd like to understand, it, so here is my WMS layer 
code

var wmsLayer = new OpenLayers.Layer.WMS(
                "WMS Layer", "/geoserver/wms",
                {
                    layers: 'streets',
                    maxResolution: 10,
                    styles: '',
                    srs: 'EPSG:4326',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' + 
map.maxExtent.bottom,
                    transparent: true
                },
                {
                    buffer: 0,
                    'opacity': 0.75, 'isBaseLayer': false, 'wrapDateLine': true
                } 
            );
   

Looking at the layer in firebug it does not have the maxResolution I set, and 
resolutions ranges from 1.40625 to 0.00004291534423828125. I tried a middle of 
the road value 0.02197265625 as both max and min resolution with no effect.

Thanks,
charles

----- Original Message -----
From: "Eric Lemoine" <[email protected]>
To: "Charles Galpin" <[email protected]>
Cc: [email protected]
Sent: Wednesday, November 3, 2010 8:34:06 AM GMT -05:00 US/Canada Eastern
Subject: Re: [OpenLayers-Users] ZoomLevels again

On Wed, Nov 3, 2010 at 1:20 PM, Charles Galpin <[email protected]> wrote:
> I know this has been discussed before and I have read the SettingZoomLevels 
> wiki page several times but I still cant figure out how to control the 
> display of my vector layer by zoom level. I must be missing something pretty 
> basic.
>
> In short, all I want to do is wait until a certain zoom level before enabling 
> the layer so it doesn't query the server before then and get too many 
> features. For example using google maps as the base layer, map.getZoom() 
> returns 14 and map.getResolution() returns 9.554 around about where I'd like 
> it to start displaying but any combination of minScale, maxScale, 
> minResolution, maxResolution, minZoomLevel, maxZoomLevel I try on my layer 
> does not seem to have any effect. I've tried 1/the number, and overly large 
> and small values to try see what affects it, but none do anything.
>
> I know I can control this with SLD in geoserver, but I'd like to control this 
> from openlayers. Does anyone have a simple example that shows this working?

Hi. Setting minResolution and/or maxResolution in the vector layer
options should work. For further help could you please provide an
example where it doesn't?

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to