[OpenLayers-Users] Grouping Layers

Arnd Wippermann arnd.wippermann at web.de
Fri Feb 20 16:47:22 EST 2009


Hi,

The grouping of layers in the mapfile should also work with OpenLayers. I do
the same with 6 layers and I have no problem with OpenLayers.Layers.WMS. I
would suggest, that you have to control your scales.

I have also accomplished this with OpenLayers. I have modified WMS.js to
pass an array of urls and appropriate layers. Depending on the zoomlevel the
url and LAYERS param of the WMS request is fetched from the array. This
approach has the advantage when requesting extern servers, because you don't
need to request them through Mapserver to group them. 

Arnd Wippermann

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Bill Thoen
Gesendet: Freitag, 20. Februar 2009 18:21
An: users at openlayers.org
Betreff: [OpenLayers-Users] Grouping Layers

I've got some NAIP imagery split into tiled layers, each with a different
resolution appropriate for the scale at which they should be displayed. But
what I'd like is to have these layers appear as one layer on the
LayerSwitcher list, and preferably in the base map section. Since I'm using
MapServer to build the images I tried using the GROUP directive to combine
the multiple layers into one while using different scales so that only one
of those layers would be visible at a time. 
Also, all my sub-layers are tile indexes (but I don't think that should
matter.) While I think this technique works in MapServer, when I try it in
OL, I get only then top layer in the group. None of the other layers appear
at any scale. Here's what I'm doing in my mapfile:
   LAYER
      NAME "naip6"
      GROUP "naip"
      TYPE RASTER
      DATA naip/naip_0000_6.tif
      STATUS ON
      MINSCALEDENOM 100000
   END

   LAYER
      NAME "naip0"
      GROUP "naip"
      TYPE RASTER
      TILEINDEX "naip0"
      TILEITEM "location"
      STATUS ON
      MAXSCALEDENOM 99999
   END

This layer is being loaded into OL as a WMS layer with the name 'naip'. 
Is this the right approach for creating a multi-zoom layer or can I even 
do something like this with OpenLayers?

Thx,
- Bill Thoen
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list