Dave,<br><br>I am not an OpenLayers expert by any means, but as of the 2.4 release (at least), now with RC5, you can add a Mapserver Layer directly. This honors the scale dependencies you have set up in your mapfile and you can have your LOD. 
<br><br>Check out <a href="http://trac.openlayers.org/wiki/MappingYourData">http://trac.openlayers.org/wiki/MappingYourData</a> for a nice tutorial. Make sure your watch the flash presentation. It makes it seem so simple.
<br><br>Andrew<br><br><div><span class="gmail_quote">On 5/30/07, <b class="gmail_sendername">Dave Weaver</b> &lt;<a href="mailto:dave.weaver@zen.co.uk">dave.weaver@zen.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m playing around with OpenLayers in conjuntion with MapServer.<br>What&#39;s the best way to have different levels of detail as I zoom in on my map?<br><br>At the moment I&#39;ve done it like this:<br>My .map file has one layer per LOD, each using a MINSCALE/MAXSCALE directive
<br>to determine when it&#39;s visible.<br><br>But that means I have multiple named layers, so the WMS request made by<br>OpenLayers needs to request all layers.<br><br>e.g: (mapfile)<br><br>&nbsp;&nbsp;LAYER<br>&nbsp;&nbsp;&nbsp;&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lod1
<br>&nbsp;&nbsp;&nbsp;&nbsp;STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF<br>&nbsp;&nbsp;&nbsp;&nbsp;TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RASTER<br>&nbsp;&nbsp;&nbsp;&nbsp;PROJECTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;init=epsg:4326&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;MINSCALE 75000000<br>&nbsp;&nbsp;&nbsp;&nbsp;METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_title&quot;&nbsp;&nbsp;&nbsp;&nbsp; &quot;lod1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_onlineresource&quot;
<br>&quot;<a href="http://example.com/cgi-bin/mapserv?map=map/earth.map&amp;">http://example.com/cgi-bin/mapserv?map=map/earth.map&amp;</a>&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_srs&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;EPSG:4326 EPSG:54004&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;END
<br>&nbsp;&nbsp;&nbsp;&nbsp;TILEINDEX&nbsp;&nbsp;&quot;lod1.shp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;TILEITEM&nbsp;&nbsp; &quot;location&quot;<br>&nbsp;&nbsp;END<br><br>&nbsp;&nbsp;LAYER<br>&nbsp;&nbsp;&nbsp;&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lod2<br>&nbsp;&nbsp;&nbsp;&nbsp;STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF<br>&nbsp;&nbsp;&nbsp;&nbsp;TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RASTER<br>&nbsp;&nbsp;&nbsp;&nbsp;PROJECTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;init=epsg:4326&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;MAXSCALE 74999999<br>&nbsp;&nbsp;&nbsp;&nbsp;MINSCALE 50000000<br>&nbsp;&nbsp;&nbsp;&nbsp;METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_title&quot;&nbsp;&nbsp;&nbsp;&nbsp; &quot;lod2&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_onlineresource&quot;<br>&quot;<a href="http://example.com/cgi-bin/mapserv?map=map/earth.map&amp;">
http://example.com/cgi-bin/mapserv?map=map/earth.map&amp;</a>&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_srs&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;EPSG:4326 EPSG:54004&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;TILEINDEX&nbsp;&nbsp;&quot;lod2.shp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;TILEITEM&nbsp;&nbsp; &quot;location&quot;
<br>&nbsp;&nbsp;END<br><br>&nbsp;&nbsp;# ... etc ...<br><br>then in the OpenLayers code:<br><br>&nbsp;&nbsp;layer = new OpenLayers.Layer.WMS( &quot;OpenLayers WMS&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;<a href="http://example.com/cgi-bin/mapserv?map=map/earth2.map&amp;">
http://example.com/cgi-bin/mapserv?map=map/earth2.map&amp;</a>&quot;, {layers:<br>&#39;lod1,lod2,lod3,lod4,lod5&#39;});<br><br>Is there a better way to handle multiple LODs ?<br><br>Many thanks,<br>Dave.<br></blockquote></div>
<br>