[mapserver-users] How to group layers

Reddy Srinivas Reddy at corp.sunday.com
Wed Jul 24 22:36:08 EDT 2002


Hi, 

I have 16 layers each for railways, roads, vegetation, etc for Hong Kong. If
I display each layer one by one it works properly. But I want to show them
all as a group. I read in the documentation that I can use "GROUP" in the
"LAYER" to combine different layers as one. But I'm not able to get it
properly. Right now I'm using the following lines to display one layer of
railways. 

Layer
  Name "rail"
  Data "Rail/rail_line_t10_polyline"
  STATUS On
  Type LINE
  Class
    Name "MTR KCR"
    Color 0 0 0
  End
End

Like "rail_line_t10_polyline" I have more layers. Could anybody help me out
to use the set of layers as one so that I can display or hide all layers at
the same time.

I tried the following code to group two layers as one and try but that
doesn't seem to work


LAYER
  NAME "rail"
  GROUP "RAILGRP"
  DATA "Rail/rail_line_t2_polyline"
  STATUS OFF
  Type LINE
  CLASS
    Name "MTR KCR"
    Color 0 0 0
  END #end of class object
END #end of layer object

LAYER
  NAME "rail2"
  GROUP "RAILGRP"
  DATA "Rail/rail_line_t3_polyline"
  STATUS OFF
  Type LINE
  CLASS
    Name "MTR KCR"
    Color 0 0 0
  END #end of class object
END #end of layer object


Cheers,
Reds.




More information about the mapserver-users mailing list