Dave,
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.
Check out http://trac.openlayers.org/wiki/MappingYourData for a nice
tutorial. Make sure your watch the flash presentation. It makes it seem so
simple.
Andrew
On 5/30/07, Dave Weaver <[EMAIL PROTECTED]> wrote:
I'm playing around with OpenLayers in conjuntion with MapServer.
What's the best way to have different levels of detail as I zoom in on my
map?
At the moment I've done it like this:
My .map file has one layer per LOD, each using a MINSCALE/MAXSCALE
directive
to determine when it's visible.
But that means I have multiple named layers, so the WMS request made by
OpenLayers needs to request all layers.
e.g: (mapfile)
LAYER
NAME lod1
STATUS OFF
TYPE RASTER
PROJECTION
"init=epsg:4326"
END
MINSCALE 75000000
METADATA
"wms_title" "lod1"
"wms_onlineresource"
"http://example.com/cgi-bin/mapserv?map=map/earth.map&"
"wms_srs" "EPSG:4326 EPSG:54004"
END
TILEINDEX "lod1.shp"
TILEITEM "location"
END
LAYER
NAME lod2
STATUS OFF
TYPE RASTER
PROJECTION
"init=epsg:4326"
END
MAXSCALE 74999999
MINSCALE 50000000
METADATA
"wms_title" "lod2"
"wms_onlineresource"
"http://example.com/cgi-bin/mapserv?map=map/earth.map&"
"wms_srs" "EPSG:4326 EPSG:54004"
END
TILEINDEX "lod2.shp"
TILEITEM "location"
END
# ... etc ...
then in the OpenLayers code:
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://example.com/cgi-bin/mapserv?map=map/earth2.map&",
{layers:
'lod1,lod2,lod3,lod4,lod5'});
Is there a better way to handle multiple LODs ?
Many thanks,
Dave.