[Mapserver-users] How to use REQUIRES in mapfile?

Steve Lime steve.lime at dnr.state.mn.us
Thu Dec 18 11:40:54 EST 2003


I do. Requires allows you to control visibility based on other layers. For example:

  REQUIRES "![landsat]"

Means that a layer will be on only if the layer named landsat is not on. You can also do and's and or's so this would work:

  REQUIRES "![landsat] and![modis]"

There is a special tag called [raster] that allows you to control a layer depending whether any raster layers are currently displayed. You might do this to make a layer transparent in one context and opaque in another. So this would be valid:

  REQUIRES "![raster]"

That is, display if no background rasters are shown. Note that context is checked only after a layer has already been made visible via MapScript or the CGI.

Steve

>>> <nicolas.fortin at ec.gc.ca> 12/18/2003 9:56:41 AM >>>
No answer yet...nobody use this element??

-----Message d'origine-----
De : nicolas.fortin at ec.gc.ca [mailto:nicolas.fortin at ec.gc.ca] 
Envoyé : Wednesday, December 17, 2003 3:20 PM
À : mapserver-users at lists.gis.umn.edu 
Objet : [Mapserver-users] How to use REQUIRES in mapfile?


Hi list,
 
I have two layers using the same grid and I only want one of them on the map
at a time so I tried to use the REQUIRES element in my mapfile as seen in
the Mapfile Reference 4.0 (07-02-2003) :
REQUIRES ([15] != 1)
Where 15 is the name of the layer using the same grid
 
And I got:
getString(): Symbol definition error. Parsing error near ([15] != 1):(line
94) 
 
How can I use this element?
Thx,

Nicolas Fortin 
Mathématicien, Programmeur, Analyste de données 
SMC-Québec Hydrologie, Environnement Canada 
1141, Rte de l'Église, Sainte-Foy(QC) G1V 4H5 
(418)648-2516 
nicolas.fortin at ec.gc.ca <mailto:nicolas.fortin at ec.gc.ca 
<mailto:nicolas.fortin at ec.gc.ca> > 

 






More information about the mapserver-users mailing list