Arnd Wippermann wrote:
> 
> Hi,
> 
> One hint 
> numZoomLevels and minZoomLevel are options and not params of the WMS
> request
> 
> 

Thank you! You were very right! :D

var chn_villages = new OpenLayers.Layer.WMS(
                                "Villages", 
"http://localhost:8080/geoserver/wms";,
{layers: 'cite:chn_villages', transparent: true}, {isBaseLayer: false,
displayInLayerSwitcher: true, visibility: false, maxResolution:
611.496226171875} 
                        );

OR an even better approach...

map.events.on({ "zoomend": function (e) {
                                
                                if (this.getZoom() > 7) {
                                        chn_villages.setVisibility(true);
                                }
                        else {
                                        chn_villages.setVisibility(false);
                        }
                }//end function (e)
                }); //end map.events.on

cheers,

elshae



-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Display-WMS-Layer-Based-on-Zoom-Level-tp5664040p5672109.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to